Blob Blame History Raw
#! /bin/sh
# Generated from /Users/akim/src/gnu/bison/tests/local.at by GNU Autoconf 2.69.
#
# Copyright (C) 2009-2012 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
if test -n "${ZSH_VERSION+set}" && (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
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; 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


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# 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
  test -z "$as_dir" && as_dir=.
    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
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH

if test "x$CONFIG_SHELL" = x; then
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (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
  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
  exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || 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_have_required=no
fi
  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :

else
  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
  test -z "$as_dir" && as_dir=.
  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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
  CONFIG_SHELL=$as_shell as_have_required=yes
		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
  break 2
fi
fi
	   done;;
       esac
  as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
  CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS


      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'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi

    if test x$as_have_required = xno; then :
  $as_echo "$0: This script requires a shell more modern than all"
  $as_echo "$0: the shells that I found on your system."
  if test x${ZSH_VERSION+set} = xset ; then
    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
  else
    $as_echo "$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_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=`$as_echo "$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 ||
$as_echo 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_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_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
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
  fi
  $as_echo "$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 ||
$as_echo 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" ||
    { $as_echo "$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
}

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

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
# List of the tested programs.
at_tested='bison'
# 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;input.at:27;Invalid options;;
2;input.at:50;Invalid inputs;;
3;input.at:80;Invalid inputs with {};;
4;input.at:107;Invalid \$n and @n;;
5;input.at:131;Type Clashes;;
6;input.at:317;Unused values;;
7;input.at:327;Unused values before symbol declarations;;
8;input.at:337;Default %printer and %destructor redeclared;;
9;input.at:408;Per-type %printer and %destructor redeclared;;
10;input.at:450;Undefined symbols;;
11;input.at:482;Unassociated types used for a printer or destructor;;
12;input.at:511;Useless printers or destructors;;
13;input.at:576;Unused values with default %destructor;;
14;input.at:624;Unused values with per-type %destructor;;
15;input.at:655;Incompatible Aliases;;
16;input.at:780;Torturing the Scanner;;
17;input.at:935;Typed symbol aliases;;
18;input.at:971;Require 1.0;;
19;input.at:972;Require 3.0.4;;
20;input.at:974;Require 100.0;;
21;input.at:981;String aliases for character tokens;;
22;input.at:1002;Symbols;;
23;input.at:1062;Numbered tokens;;
24;input.at:1100;Unclosed constructs;;
25;input.at:1155;%start after first rule;;
26;input.at:1176;%prec takes a token;;
27;input.at:1197;%prec's token must be defined;;
28;input.at:1217;Reject unused %code qualifiers;;
29;input.at:1306;Multiple %code;;
30;input.at:1345;errors;;
31;input.at:1381;%define, --define, --force-define;;
32;input.at:1446;\"%define\" Boolean variables;;
33;input.at:1466;\"%define\" code variables;;
34;input.at:1499;\"%define\" keyword variables;;
35;input.at:1532;\"%define\" enum variables;;
36;input.at:1574;\"%define\" backward compatibility;;
37;input.at:1613;Unused api.pure;;
38;input.at:1646;C++ namespace reference errors;;
39;input.at:1702;Bad character literals;;
40;input.at:1765;Bad escapes in literals;;
41;input.at:1814;LAC: Errors for %define;;
42;input.at:1837;-Werror combinations;;
43;input.at:1882;%name-prefix and api.prefix are incompatible;;
44;input.at:1911;Redefined %union name;;
45;input.at:1956;Stray \$ or @;;
46;input.at:1994;Code injection;;
47;input.at:2057;Deprecated directives;deprec;
48;input.at:2110;Unput's effect on locations;deprec;
49;input.at:2143;Non-deprecated directives;deprec;
50;named-refs.at:21;Tutorial calculator;;
51;named-refs.at:196;Undefined and ambiguous references;;
52;named-refs.at:297;Misleading references;;
53;named-refs.at:314;Many kinds of errors;;
54;named-refs.at:547;Missing identifiers in brackets;;
55;named-refs.at:561;Redundant words in brackets;;
56;named-refs.at:575;Comments in brackets;;
57;named-refs.at:589;Stray symbols in brackets;;
58;named-refs.at:606;Redundant words in LHS brackets;;
59;named-refs.at:621;Factored LHS;;
60;named-refs.at:632;Unresolved references;;
61;named-refs.at:697;\$ or @ followed by . or -;;
62;output.at:56;Output files:  -dv;;
63;output.at:62;Output files:  -dv >&-;;
64;output.at:67;Output files:  -dv -o foo.c;;
65;output.at:69;Output files:  -dv -o foo.tab.c;;
66;output.at:72;Output files:  -dv -g --xml -y;;
67;output.at:75;Output files:  -dv -g --xml -o y.tab.c;;
68;output.at:78;Output files:  -dv -b bar;;
69;output.at:80;Output files:  -dv -g -o foo.c;;
70;output.at:84;Output files: %defines %verbose ;;
71;output.at:86;Output files: %defines %verbose %yacc ;;
72;output.at:89;Output files: %defines %verbose %yacc ;;
73;output.at:93;Output files: %file-prefix \"bar\" %defines %verbose ;;
74;output.at:95;Output files: %output \"bar.c\" %defines %verbose %yacc ;;
75;output.at:97;Output files: %file-prefix \"baz\" %output \"bar.c\" %defines %verbose %yacc ;;
76;output.at:104;Output files: %defines %verbose ;;
77;output.at:107;Output files: %defines %verbose  -o foo.c;;
78;output.at:110;Output files:  --defines=foo.hpp -o foo.c++;;
79;output.at:114;Output files: %defines \"foo.hpp\" -o foo.c++;;
80;output.at:118;Output files:  -o foo.c++ --graph=foo.gph;;
81;output.at:124;Output files: %type <foo> useless --defines --graph --xml --report=all -Wall -Werror;;
82;output.at:131;Output files: useless=--defines --graph --xml --report=all -Wall -Werror;;
83;output.at:147;Output files: lalr1.cc %verbose ;;
84;output.at:150;Output files: lalr1.cc %defines %verbose ;;
85;output.at:153;Output files: lalr1.cc %verbose %locations ;;
86;output.at:156;Output files: lalr1.cc %defines %verbose %locations ;;
87;output.at:159;Output files: lalr1.cc %defines %verbose ;;
88;output.at:163;Output files: lalr1.cc %defines %verbose %locations -o subdir/foo.cc;;
89;output.at:168;Output files: lalr1.cc %defines %verbose %file-prefix \"output_dir/foo\" ;;
90;output.at:173;Output files: lalr1.cc %defines %locations %verbose %file-prefix \"output_dir/foo\" ;;
91;output.at:203;Conflicting output files:  --graph=\"foo.tab.c\";;
92;output.at:208;Conflicting output files: %defines \"foo.output\" -v;;
93;output.at:213;Conflicting output files: lalr1.cc %defines %locations --graph=\"location.hh\";;
94;output.at:218;Conflicting output files:  -o foo.y;;
95;output.at:264;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++;
96;output.at:271;Output file name: (;c++;
97;output.at:272;Output file name: );c++;
98;output.at:273;Output file name: #;c++;
99;output.at:274;Output file name: @@;c++;
100;output.at:275;Output file name: @{;c++;
101;output.at:276;Output file name: @};c++;
102;output.at:277;Output file name: [;c++;
103;output.at:278;Output file name: ];c++;
104;output.at:305;Graph with no conflicts;graph;
105;output.at:339;Graph with unsolved S/R;graph;
106;output.at:403;Graph with solved S/R;graph;
107;output.at:462;Graph with R/R;graph;
108;output.at:494;Graph with reductions with multiple LAT;graph;
109;output.at:553;Graph with a reduction rule both enabled and disabled;graph;
110;skeletons.at:24;Relative skeleton file names;;
111;skeletons.at:84;Installed skeleton file names;;
112;skeletons.at:141;Boolean=variables: invalid skeleton defaults;;
113;skeletons.at:165;Complaining during macro argument expansion;;
114;skeletons.at:247;Fatal errors make M4 exit immediately;;
115;skeletons.at:301;Fatal errors but M4 continues producing output;;
116;sets.at:66;Nullable;;
117;sets.at:151;Broken Closure;;
118;sets.at:193;Firsts;;
119;sets.at:269;Accept;;
120;reduce.at:25;Useless Terminals;;
121;reduce.at:69;Useless Nonterminals;;
122;reduce.at:124;Useless Rules;report;
123;reduce.at:249;Reduced Automaton;report;
124;reduce.at:349;Underivable Rules;report;
125;reduce.at:391;Empty Language;;
126;reduce.at:442;no lr.type: Single State Split;;
127;reduce.at:442;lr.type=lalr: Single State Split;;
128;reduce.at:442;lr.type=ielr: Single State Split;;
129;reduce.at:442;lr.type=canonical-lr: Single State Split;;
130;reduce.at:675;no lr.type: Lane Split;;
131;reduce.at:675;lr.type=lalr: Lane Split;;
132;reduce.at:675;lr.type=ielr: Lane Split;;
133;reduce.at:675;lr.type=canonical-lr: Lane Split;;
134;reduce.at:919;no lr.type: Complex Lane Split;;
135;reduce.at:919;lr.type=lalr: Complex Lane Split;;
136;reduce.at:919;lr.type=ielr: Complex Lane Split;;
137;reduce.at:919;lr.type=canonical-lr: Complex Lane Split;;
138;reduce.at:1188;no lr.type: Split During Added Lookahead Propagation;;
139;reduce.at:1188;lr.type=lalr: Split During Added Lookahead Propagation;;
140;reduce.at:1188;lr.type=ielr: Split During Added Lookahead Propagation;;
141;reduce.at:1188;lr.type=canonical-lr: Split During Added Lookahead Propagation;;
142;reduce.at:1518;no lr.default-reduction;;
143;reduce.at:1518;lr.default-reduction=most;;
144;reduce.at:1518;lr.default-reduction=consistent;;
145;reduce.at:1518;lr.default-reduction=accepting;;
146;conflicts.at:27;Token declaration order;;
147;conflicts.at:100;Token declaration order: literals vs. identifiers;;
148;conflicts.at:180;Useless associativity warning;;
149;conflicts.at:215;Useless precedence warning;;
150;conflicts.at:272;S/R in initial;;
151;conflicts.at:298;%nonassoc and eof;;
152;conflicts.at:522;parse.error=verbose and consistent errors: lr.type=ielr;;
153;conflicts.at:526;parse.error=verbose and consistent errors: lr.type=ielr %glr-parser;glr;
154;conflicts.at:531;parse.error=verbose and consistent errors: lr.type=ielr c++;c++;
155;conflicts.at:536;parse.error=verbose and consistent errors: lr.type=ielr java;java;
156;conflicts.at:543;parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=consistent;;
157;conflicts.at:548;parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=accepting;;
158;conflicts.at:553;parse.error=verbose and consistent errors: lr.type=canonical-lr;;
159;conflicts.at:559;parse.error=verbose and consistent errors: lr.type=canonical-lr parse.lac=full;;
160;conflicts.at:564;parse.error=verbose and consistent errors: lr.type=ielr parse.lac=full;;
161;conflicts.at:620;parse.error=verbose and consistent errors: ;;
162;conflicts.at:624;parse.error=verbose and consistent errors: %glr-parser;glr;
163;conflicts.at:630;parse.error=verbose and consistent errors: lr.default-reduction=consistent;;
164;conflicts.at:636;parse.error=verbose and consistent errors: lr.default-reduction=accepting;;
165;conflicts.at:640;parse.error=verbose and consistent errors: lr.type=canonical-lr;;
166;conflicts.at:645;parse.error=verbose and consistent errors: parse.lac=full;;
167;conflicts.at:649;parse.error=verbose and consistent errors: parse.lac=full lr.default-reduction=accepting;;
168;conflicts.at:674;LAC: %nonassoc requires splitting canonical LR states;;
169;conflicts.at:759;Unresolved SR Conflicts;report;
170;conflicts.at:866;Resolved SR Conflicts;report;
171;conflicts.at:967;%precedence suffices;;
172;conflicts.at:993;%precedence does not suffice;;
173;conflicts.at:1044;Defaulted Conflicted Reduction;report;
174;conflicts.at:1163;%expect not enough;;
175;conflicts.at:1182;%expect right;;
176;conflicts.at:1199;%expect too much;;
177;conflicts.at:1218;%expect with reduce conflicts;;
178;conflicts.at:1237;%prec with user string;;
179;conflicts.at:1254;%no-default-prec without %prec;;
180;conflicts.at:1282;%no-default-prec with %prec;;
181;conflicts.at:1306;%default-prec;;
182;conflicts.at:1330;Unreachable States After Conflict Resolution;;
183;conflicts.at:1543;Solved conflicts report for multiple reductions in a state;;
184;conflicts.at:1623;%nonassoc error actions for multiple reductions in a state;;
185;conflicts.at:1692;%expect-rr non GLR;;
186;conflicts.at:1723;-W versus %expect and %expect-rr;;
187;synclines.at:173;Prologue syncline;;
188;synclines.at:191;%union syncline;;
189;synclines.at:214;%union name syncline;;
190;synclines.at:241;Postprologue syncline;;
191;synclines.at:265;Action syncline;;
192;synclines.at:284;Epilogue syncline;;
193;synclines.at:301;%code top syncline;;
194;synclines.at:342;%no-lines: yacc.c;;
195;synclines.at:343;%no-lines: glr.c;glr;
196;synclines.at:344;%no-lines: lalr1.cc;;
197;synclines.at:345;%no-lines: glr.cc;glr;
198;headers.at:57;Invalid CPP guards:  --defines=input/input.h;;
199;headers.at:58;Invalid CPP guards:  --defines=9foo.h;;
200;headers.at:59;Invalid CPP guards: %glr-parser --defines=input/input.h;glr;
201;headers.at:60;Invalid CPP guards: %glr-parser --defines=9foo.h;glr;
202;headers.at:69;export YYLTYPE;;
203;headers.at:112;Several parsers;glr c++;
204;actions.at:24;Mid-rule actions;;
205;actions.at:71;Implicitly empty rule;;
206;actions.at:112;Invalid uses of %empty;;
207;actions.at:157;Valid uses of %empty;;
208;actions.at:241;Initial location: yacc.c ;;
209;actions.at:242;Initial location: yacc.c api.pure=full;;
210;actions.at:243;Initial location: yacc.c api.pure %parse-param { int x };;
211;actions.at:244;Initial location: yacc.c api.push-pull=both;;
212;actions.at:245;Initial location: yacc.c api.push-pull=both api.pure=full;;
213;actions.at:246;Initial location: glr.c ;glr;
214;actions.at:247;Initial location: glr.c api.pure;glr;
215;actions.at:248;Initial location: lalr1.cc ;c++;
216;actions.at:249;Initial location: glr.cc ;glr c++;
217;actions.at:258;Initial location: yacc.c api.pure=full;;
218;actions.at:269;Initial location: yacc.c api.pure=full;;
219;actions.at:352;Location print: yacc.c ;;
220;actions.at:353;Location print: glr.c ;glr;
221;actions.at:354;Location print: lalr1.cc ;c++;
222;actions.at:355;Location print: glr.cc ;glr c++;
223;actions.at:365;Exotic Dollars;;
224;actions.at:850;Printers and Destructors;;
225;actions.at:851;Printers and Destructors with union;;
226;actions.at:853;Printers and Destructors: %defines lalr1.cc;c++;
227;actions.at:854;Printers and Destructors with union: %defines lalr1.cc;c++;
228;actions.at:856;Printers and Destructors: %glr-parser;glr;
229;actions.at:857;Printers and Destructors with union: %glr-parser;glr;
230;actions.at:868;Default tagless %printer and %destructor;;
231;actions.at:961;Default tagged and per-type %printer and %destructor;;
232;actions.at:1080;Default %printer and %destructor for user-defined end token;;
233;actions.at:1190;Default %printer and %destructor are not for error or \$undefined;;
234;actions.at:1283;Default %printer and %destructor are not for \$accept;;
235;actions.at:1347;Default %printer and %destructor for mid-rule values;;
236;actions.at:1492;@\$ in %initial-action implies %locations;;
237;actions.at:1493;@\$ in %destructor implies %locations;;
238;actions.at:1494;@\$ in %printer implies %locations;;
239;actions.at:1606;Qualified \$\$ in actions: yacc.c;;
240;actions.at:1607;Qualified \$\$ in actions: glr.c;glr;
241;actions.at:1608;Qualified \$\$ in actions: lalr1.cc;c++;
242;actions.at:1609;Qualified \$\$ in actions: glr.cc;glr c++;
243;actions.at:1617;Destroying lookahead assigned by semantic action;;
244;actions.at:1672;YYBACKUP;;
245;types.at:25;%union vs. api.value.type;;
246;types.at:44;%yacc vs. api.value.type=union;;
247;types.at:128;yacc.c api.value.type={double};api.value.type;
248;types.at:128;yacc.c api.value.type={double} %defines;api.value.type;
249;types.at:128;yacc.c api.value.type={variant};api.value.type;
250;types.at:128;yacc.c api.value.type={variant} %defines;api.value.type;
251;types.at:128;yacc.c api.value.type={struct foo};api.value.type;
252;types.at:128;yacc.c api.value.type={struct foo} %defines;api.value.type;
253;types.at:128;yacc.c api.value.type={struct bar};api.value.type;
254;types.at:128;yacc.c api.value.type={struct bar} %defines;api.value.type;
255;types.at:128;yacc.c api.value.type={union foo};api.value.type;
256;types.at:128;yacc.c api.value.type={union foo} %defines;api.value.type;
257;types.at:128;yacc.c %union { float fval; int ival; };;api.value.type;
258;types.at:128;yacc.c %union { float fval; int ival; }; %defines;api.value.type;
259;types.at:128;yacc.c %union foo { float fval; int ival; };;api.value.type;
260;types.at:128;yacc.c %union foo { float fval; int ival; }; %defines;api.value.type;
261;types.at:128;yacc.c api.value.union.name=foo; %union { float fval; int ival; };;api.value.type;
262;types.at:128;yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %defines;api.value.type;
263;types.at:128;yacc.c api.value.type=union;api.value.type;
264;types.at:128;yacc.c api.value.type=union %defines;api.value.type;
265;types.at:128;glr.c api.value.type={double};api.value.type glr;
266;types.at:128;glr.c api.value.type={double} %defines;api.value.type glr;
267;types.at:128;glr.c api.value.type={variant};api.value.type glr;
268;types.at:128;glr.c api.value.type={variant} %defines;api.value.type glr;
269;types.at:128;glr.c api.value.type={struct foo};api.value.type glr;
270;types.at:128;glr.c api.value.type={struct foo} %defines;api.value.type glr;
271;types.at:128;glr.c api.value.type={struct bar};api.value.type glr;
272;types.at:128;glr.c api.value.type={struct bar} %defines;api.value.type glr;
273;types.at:128;glr.c api.value.type={union foo};api.value.type glr;
274;types.at:128;glr.c api.value.type={union foo} %defines;api.value.type glr;
275;types.at:128;glr.c %union { float fval; int ival; };;api.value.type glr;
276;types.at:128;glr.c %union { float fval; int ival; }; %defines;api.value.type glr;
277;types.at:128;glr.c %union foo { float fval; int ival; };;api.value.type glr;
278;types.at:128;glr.c %union foo { float fval; int ival; }; %defines;api.value.type glr;
279;types.at:128;glr.c api.value.union.name=foo; %union { float fval; int ival; };;api.value.type glr;
280;types.at:128;glr.c api.value.union.name=foo; %union { float fval; int ival; }; %defines;api.value.type glr;
281;types.at:128;glr.c api.value.type=union;api.value.type glr;
282;types.at:128;glr.c api.value.type=union %defines;api.value.type glr;
283;types.at:128;lalr1.cc api.value.type={double};api.value.type c++;
284;types.at:128;lalr1.cc api.value.type={double} %defines;api.value.type c++;
285;types.at:128;lalr1.cc api.value.type={variant};api.value.type c++;
286;types.at:128;lalr1.cc api.value.type={variant} %defines;api.value.type c++;
287;types.at:128;lalr1.cc api.value.type={struct foo};api.value.type c++;
288;types.at:128;lalr1.cc api.value.type={struct foo} %defines;api.value.type c++;
289;types.at:128;lalr1.cc api.value.type={struct bar};api.value.type c++;
290;types.at:128;lalr1.cc api.value.type={struct bar} %defines;api.value.type c++;
291;types.at:128;lalr1.cc api.value.type={union foo};api.value.type c++;
292;types.at:128;lalr1.cc api.value.type={union foo} %defines;api.value.type c++;
293;types.at:128;lalr1.cc %union { float fval; int ival; };;api.value.type c++;
294;types.at:128;lalr1.cc %union { float fval; int ival; }; %defines;api.value.type c++;
295;types.at:128;lalr1.cc api.value.type=union;api.value.type c++;
296;types.at:128;lalr1.cc api.value.type=union %defines;api.value.type c++;
297;types.at:128;lalr1.cc api.value.type=variant;api.value.type c++;
298;types.at:128;lalr1.cc api.value.type=variant %defines;api.value.type c++;
299;types.at:128;glr.cc api.value.type={double};api.value.type glr c++;
300;types.at:128;glr.cc api.value.type={double} %defines;api.value.type glr c++;
301;types.at:128;glr.cc api.value.type={variant};api.value.type glr c++;
302;types.at:128;glr.cc api.value.type={variant} %defines;api.value.type glr c++;
303;types.at:128;glr.cc api.value.type={struct foo};api.value.type glr c++;
304;types.at:128;glr.cc api.value.type={struct foo} %defines;api.value.type glr c++;
305;types.at:128;glr.cc api.value.type={struct bar};api.value.type glr c++;
306;types.at:128;glr.cc api.value.type={struct bar} %defines;api.value.type glr c++;
307;types.at:128;glr.cc api.value.type={union foo};api.value.type glr c++;
308;types.at:128;glr.cc api.value.type={union foo} %defines;api.value.type glr c++;
309;types.at:128;glr.cc %union { float fval; int ival; };;api.value.type glr c++;
310;types.at:128;glr.cc %union { float fval; int ival; }; %defines;api.value.type glr c++;
311;types.at:128;glr.cc api.value.type=union;api.value.type glr c++;
312;types.at:128;glr.cc api.value.type=union %defines;api.value.type glr c++;
313;types.at:263;lalr1.cc: Named %union;;
314;types.at:263;glr.cc: Named %union;;
315;calc.at:596;Calculator ;;
316;calc.at:598;Calculator %defines;;
317;calc.at:599;Calculator %locations;;
318;calc.at:601;Calculator %name-prefix \"calc\";;
319;calc.at:602;Calculator %verbose;;
320;calc.at:603;Calculator %yacc;;
321;calc.at:604;Calculator parse.error=verbose;;
322;calc.at:606;Calculator api.pure=full %locations;;
323;calc.at:607;Calculator api.push-pull=both api.pure=full %locations;;
324;calc.at:608;Calculator parse.error=verbose %locations;;
325;calc.at:610;Calculator parse.error=verbose %locations %defines api.prefix={calc} %verbose %yacc;;
326;calc.at:611;Calculator parse.error=verbose %locations %defines %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc;;
327;calc.at:613;Calculator %debug;;
328;calc.at:614;Calculator parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
329;calc.at:615;Calculator parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc;;
330;calc.at:617;Calculator api.pure=full parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
331;calc.at:618;Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc;;
332;calc.at:620;Calculator api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
333;calc.at:637;Calculator %glr-parser ;glr;
334;calc.at:639;Calculator %glr-parser %defines;glr;
335;calc.at:640;Calculator %glr-parser %locations;glr;
336;calc.at:641;Calculator %glr-parser %name-prefix \"calc\";glr;
337;calc.at:642;Calculator %glr-parser api.prefix={calc};glr;
338;calc.at:643;Calculator %glr-parser %verbose;glr;
339;calc.at:644;Calculator %glr-parser %yacc;glr;
340;calc.at:645;Calculator %glr-parser parse.error=verbose;glr;
341;calc.at:647;Calculator %glr-parser api.pure %locations;glr;
342;calc.at:648;Calculator %glr-parser parse.error=verbose %locations;glr;
343;calc.at:650;Calculator %glr-parser parse.error=verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;glr;
344;calc.at:652;Calculator %glr-parser %debug;glr;
345;calc.at:653;Calculator %glr-parser parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;glr;
346;calc.at:654;Calculator %glr-parser parse.error=verbose %debug %locations %defines api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc;glr;
347;calc.at:656;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;glr;
348;calc.at:658;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};glr;
349;calc.at:659;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};glr;
350;calc.at:669;Calculator lalr1.cc %defines;c++;
351;calc.at:678;Calculator C++ ;c++;
352;calc.at:679;Calculator C++ %locations;c++;
353;calc.at:680;Calculator C++ %locations api.location.type={Span};c++;
354;calc.at:681;Calculator C++ %defines %locations parse.error=verbose %name-prefix \"calc\" %verbose %yacc;c++;
355;calc.at:683;Calculator C++ %locations parse.error=verbose api.prefix={calc} %verbose %yacc;c++;
356;calc.at:684;Calculator C++ %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
357;calc.at:686;Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc;c++;
358;calc.at:687;Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc;c++;
359;calc.at:689;Calculator C++ %defines %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
360;calc.at:691;Calculator C++ parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
361;calc.at:692;Calculator C++ %defines %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
362;calc.at:703;Calculator glr.cc;glr c++;
363;calc.at:712;Calculator C++ %glr-parser ;glr c++;
364;calc.at:713;Calculator C++ %glr-parser %locations;glr c++;
365;calc.at:714;Calculator C++ %glr-parser %locations api.location.type={Span};glr c++;
366;calc.at:715;Calculator C++ %glr-parser %defines parse.error=verbose %name-prefix \"calc\" %verbose %yacc;glr c++;
367;calc.at:716;Calculator C++ %glr-parser parse.error=verbose api.prefix={calc} %verbose %yacc;glr c++;
368;calc.at:718;Calculator C++ %glr-parser %debug;glr c++;
369;calc.at:720;Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc;glr c++;
370;calc.at:721;Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc;glr c++;
371;calc.at:723;Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};glr c++;
372;calc.at:724;Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};glr c++;
373;torture.at:132;Big triangle;;
374;torture.at:216;Big horizontal;;
375;torture.at:348;Many lookahead tokens;;
376;torture.at:450;Exploding the Stack Size with Alloca;;
377;torture.at:496;Exploding the Stack Size with Malloc;;
378;existing.at:79;GNU AWK 3.1.0 Grammar: LALR(1);;
379;existing.at:79;GNU AWK 3.1.0 Grammar: IELR(1);;
380;existing.at:79;GNU AWK 3.1.0 Grammar: Canonical LR(1);;
381;existing.at:811;GNU Cim Grammar: LALR(1);;
382;existing.at:811;GNU Cim Grammar: IELR(1);;
383;existing.at:811;GNU Cim Grammar: Canonical LR(1);;
384;existing.at:1461;GNU pic (Groff 1.18.1) Grammar: LALR(1);;
385;existing.at:1461;GNU pic (Groff 1.18.1) Grammar: IELR(1);;
386;existing.at:1461;GNU pic (Groff 1.18.1) Grammar: Canonical LR(1);;
387;regression.at:25;Trivial grammars;;
388;regression.at:55;YYSTYPE typedef;;
389;regression.at:85;Early token definitions with --yacc;;
390;regression.at:125;Early token definitions without --yacc;;
391;regression.at:170;Braces parsing;;
392;regression.at:194;Duplicate string;;
393;regression.at:222;Rule Line Numbers;report;
394;regression.at:368;Mixing %token styles;;
395;regression.at:394;Invalid inputs;;
396;regression.at:421;Invalid inputs with {};;
397;regression.at:446;Token definitions;;
398;regression.at:507;Characters Escapes;;
399;regression.at:540;Web2c Report;report;
400;regression.at:717;Web2c Actions;report;
401;regression.at:906;Dancer ;;
402;regression.at:907;Dancer %glr-parser;glr;
403;regression.at:908;Dancer lalr1.cc;c++;
404;regression.at:983;Expecting two tokens ;;
405;regression.at:984;Expecting two tokens %glr-parser;glr;
406;regression.at:985;Expecting two tokens lalr1.cc;c++;
407;regression.at:993;Braced code in declaration in rules section;;
408;regression.at:1052;String alias declared after use;;
409;regression.at:1075;Extra lookahead sets in report;;
410;regression.at:1116;Token number in precedence declaration;;
411;regression.at:1169;parse-gram.y: LALR = IELR;;
412;regression.at:1191;parse.error=verbose and YYSTACK_USE_ALLOCA;;
413;regression.at:1265;parse.error=verbose overflow;;
414;regression.at:1375;LAC: Exploratory stack;;
415;regression.at:1463;LAC: Memory exhaustion;;
416;regression.at:1593;Lex and parse params: yacc.c;;
417;regression.at:1594;Lex and parse params: glr.c;glr;
418;regression.at:1595;Lex and parse params: lalr1.cc;c++;
419;regression.at:1596;Lex and parse params: glr.cc;glr c++;
420;regression.at:1607;stdio.h is not needed;;
421;push.at:24;Memory Leak for Early Deletion;;
422;push.at:83;Multiple impure instances;;
423;push.at:144;Unsupported Skeletons;;
424;c++.at:25;C++ Locations;c++;
425;c++.at:94;C++ Variant-based Symbols;variant c++;
426;c++.at:370;Variants lalr1.cc ;c++;
427;c++.at:371;Variants lalr1.cc parse.assert;c++;
428;c++.at:372;Variants lalr1.cc parse.assert %locations;c++;
429;c++.at:373;Variants lalr1.cc parse.assert %code {\\n#define TWO_STAGE_BUILD\\n};c++;
430;c++.at:374;Variants lalr1.cc parse.assert api.token.constructor;c++;
431;c++.at:375;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_};c++;
432;c++.at:376;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations;c++;
433;c++.at:460;Doxygen Public Documentation;;
434;c++.at:461;Doxygen Private Documentation;;
435;c++.at:515;Relative namespace references;c++;
436;c++.at:521;Absolute namespace references;c++;
437;c++.at:530;Syntactically invalid namespace references;;
438;c++.at:550;Syntax error discarding no lookahead;c++;
439;c++.at:623;Syntax error as exception;c++;
440;c++.at:973;Exception safety with error recovery ;c++;
441;c++.at:974;Exception safety without error recovery ;c++;
442;c++.at:975;Exception safety with error recovery api.value.type=variant;c++;
443;c++.at:976;Exception safety without error recovery api.value.type=variant;c++;
444;c++.at:984;C++ GLR parser identifier shadowing;c++;
445;java.at:360;Calculator ;java;
446;java.at:360;Calculator %error-verbose ;java;
447;java.at:360;Calculator %locations ;java;
448;java.at:360;Calculator %error-verbose %locations ;java;
449;java.at:369;Calculator %lex-param { InputStream is } ;java;
450;java.at:369;Calculator %error-verbose %lex-param { InputStream is } ;java;
451;java.at:369;Calculator %locations %lex-param { InputStream is } ;java;
452;java.at:369;Calculator %error-verbose %locations %lex-param { InputStream is } ;java;
453;java.at:455;Java parser class and package names;java;
454;java.at:479;Java parser class modifiers;java;
455;java.at:543;Java parser class extends and implements;java;
456;java.at:563;Java %parse-param and %lex-param;java;
457;java.at:637;Java throws specifications;java;
458;java.at:726;Java constructor init and init_throws;java;
459;java.at:753;Java value, position, and location types;java;
460;java.at:784;Java syntax error handling without error token;java;
461;javapush.at:168;Trivial Push Parser with api.push-pull verification;java;
462;javapush.at:213;Trivial Push Parser with %initial-action;java;
463;javapush.at:311;Calc parser with api.push-pull both;java;
464;javapush.at:599;Calc parser with %locations %code lexer and api.push-pull both;java;
465;cxx-type.at:394;GLR: Resolve ambiguity, impure, no locations;glr;
466;cxx-type.at:401;GLR: Resolve ambiguity, impure, locations;glr;
467;cxx-type.at:407;GLR: Resolve ambiguity, pure, no locations;glr;
468;cxx-type.at:414;GLR: Resolve ambiguity, pure, locations;glr;
469;cxx-type.at:421;GLR: Merge conflicting parses, impure, no locations;glr;
470;cxx-type.at:428;GLR: Merge conflicting parses, impure, locations;glr;
471;cxx-type.at:435;GLR: Merge conflicting parses, pure, no locations;glr;
472;cxx-type.at:441;GLR: Merge conflicting parses, pure, locations;glr;
473;cxx-type.at:448;GLR: Verbose messages, resolve ambiguity, impure, no locations;glr;
474;glr-regression.at:25;Badly Collapsed GLR States;;
475;glr-regression.at:112;Improper handling of embedded actions and dollar(-N) in GLR parsers;;
476;glr-regression.at:244;Improper merging of GLR delayed action sets;;
477;glr-regression.at:365;Duplicate representation of merged trees;;
478;glr-regression.at:456;User destructor for unresolved GLR semantic value;;
479;glr-regression.at:512;User destructor after an error during a split parse;;
480;glr-regression.at:562;Duplicated user destructor for lookahead;;
481;glr-regression.at:651;Incorrectly initialized location for empty right-hand side in GLR;;
482;glr-regression.at:740;No users destructors if stack 0 deleted;;
483;glr-regression.at:817;Corrupted semantic options if user action cuts parse;;
484;glr-regression.at:871;Undesirable destructors if user action cuts parse;;
485;glr-regression.at:929;Leaked semantic values if user action cuts parse;;
486;glr-regression.at:1053;Incorrect lookahead during deterministic GLR;;
487;glr-regression.at:1177;Incorrect lookahead during nondeterministic GLR;;
488;glr-regression.at:1394;Leaked semantic values when reporting ambiguity;;
489;glr-regression.at:1476;Leaked lookahead after nondeterministic parse syntax error;;
490;glr-regression.at:1536;Uninitialized location when reporting ambiguity;glr;
491;glr-regression.at:1610;Missed %merge type warnings when LHS type is declared later;;
492;glr-regression.at:1659;Ambiguity reports;;
493;glr-regression.at:1760;Predicates;;
"
# List of the all the test groups.
at_groups_all=`$as_echo "$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 493; then
      $as_echo "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
}

##
## 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

  # Accept the important Cygnus configure options, so we can diagnose typos.

  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=`$as_echo "$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=`$as_echo "$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=`$as_echo "$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=`$as_echo "$at_groups_selected" |
	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
	done
	# Smash the keywords.
	at_groups_selected=`$as_echo "$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=`$as_echo "$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'"
	;;

     *) $as_echo "$as_me: invalid option: $at_option" >&2
	$as_echo "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=`$as_echo "$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: <http://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.0.4 test suite test groups:

 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
      KEYWORDS

_ATEOF
  # Pass an empty line as separator between selected groups and help.
  $as_echo "$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
  $as_echo "$as_me (GNU Bison 3.0.4)" &&
  cat <<\_ATEOF || at_write_fail=1

Copyright (C) 2012 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. input.at:18
# Category starts at test group 1.
at_banner_text_1="Input Processing."
# Banner 2. named-refs.at:19
# Category starts at test group 50.
at_banner_text_2="Named references tests."
# Banner 3. output.at:18
# Category starts at test group 62.
at_banner_text_3="Output file names."
# Banner 4. skeletons.at:18
# Category starts at test group 110.
at_banner_text_4="Skeleton Support."
# Banner 5. sets.at:59
# Category starts at test group 116.
at_banner_text_5="Grammar Sets (Firsts etc.)."
# Banner 6. reduce.at:18
# Category starts at test group 120.
at_banner_text_6="Grammar Reduction."
# Banner 7. conflicts.at:18
# Category starts at test group 146.
at_banner_text_7="Conflicts."
# Banner 8. synclines.at:19
# Category starts at test group 187.
at_banner_text_8="User Actions."
# Banner 9. headers.at:19
# Category starts at test group 198.
at_banner_text_9="Parser Headers."
# Banner 10. actions.at:18
# Category starts at test group 204.
at_banner_text_10="User Actions."
# Banner 11. types.at:18
# Category starts at test group 245.
at_banner_text_11="Value type tests."
# Banner 12. calc.at:587
# Category starts at test group 315.
at_banner_text_12="Simple LALR(1) Calculator."
# Banner 13. calc.at:627
# Category starts at test group 333.
at_banner_text_13="Simple GLR Calculator."
# Banner 14. calc.at:666
# Category starts at test group 350.
at_banner_text_14="Simple LALR(1) C++ Calculator."
# Banner 15. calc.at:700
# Category starts at test group 362.
at_banner_text_15="Simple GLR C++ Calculator."
# Banner 16. torture.at:19
# Category starts at test group 373.
at_banner_text_16="Torture Tests."
# Banner 17. existing.at:19
# Category starts at test group 378.
at_banner_text_17="Existing Grammars."
# Banner 18. regression.at:18
# Category starts at test group 387.
at_banner_text_18="Regression tests."
# Banner 19. push.at:18
# Category starts at test group 421.
at_banner_text_19="Push Parsing Tests"
# Banner 20. c++.at:18
# Category starts at test group 424.
at_banner_text_20="C++ Features."
# Banner 21. java.at:18
# Category starts at test group 445.
at_banner_text_21="Java Calculator."
# Banner 22. java.at:382
# Category starts at test group 453.
at_banner_text_22="Java Parameters."
# Banner 23. javapush.at:41
# Category starts at test group 461.
at_banner_text_23="Java Push Parsing Tests"
# Banner 24. cxx-type.at:18
# Category starts at test group 465.
at_banner_text_24="C++ Type Syntax (GLR)."
# Banner 25. glr-regression.at:19
# Category starts at test group 474.
at_banner_text_25="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=`$as_echo "$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
  test -z "$as_dir" && as_dir=.
    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
  test -z "$as_dir" && as_dir=.
    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.
$as_echo "## --------------------------- ##
## GNU Bison 3.0.4 test suite. ##
## --------------------------- ##"
{
  $as_echo "## --------------------------- ##
## GNU Bison 3.0.4 test suite. ##
## --------------------------- ##"
  echo

  $as_echo "$as_me: command line was:"
  $as_echo "  \$ $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
    $as_echo "## ---------- ##
## 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
  test -z "$as_dir" && as_dir=.
    $as_echo "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
    $as_echo "$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
    $as_echo "$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)"
  $as_echo "$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 ()
{
  $as_echo "$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 $as_echo "$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=:
	$as_echo "$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=:
	$as_echo "$3: hard failure"; exit 99;;
    *) $as_echo "$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+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
    $as_echo "cd '$at_dir'" &&
    $as_echo "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. ##
## -------------------------------- ##
{
  $as_echo "## ---------------- ##
## Tested programs. ##
## ---------------- ##"
  echo
} >&5

# Report what programs are being tested.
for at_program in : $at_tested
do
  test "$at_program" = : && continue
  case $at_program in
    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
    * )
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    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
    {
      $as_echo "$at_srcdir/local.at:1102: $at_program_ --version"
      "$at_program_" --version </dev/null
      echo
    } >&5 2>&1
  else
    as_fn_error $? "cannot find $at_program" "$LINENO" 5
  fi
done

{
  $as_echo "## ------------------ ##
## Running the tests. ##
## ------------------ ##"
} >&5

at_start_date=`date`
at_start_time=`date +%s 2>/dev/null`
$as_echo "$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 ||
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
$as_echo "$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 $as_echo_n "$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
    $as_echo "$at_setup_line" >"$at_check_line_file"
    at_status=99
  fi
  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
  $as_echo_n "$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
    $as_echo "$at_desc_line $at_color$at_msg$at_std"
  else
    # Make sure there is a separator even with long titles.
    $as_echo " $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
      $as_echo "$at_log_msg" >> "$at_group_log"
      $as_echo "$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.
      $as_echo "$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
	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
$as_echo "$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+set}" = set && 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=`$as_echo "$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
	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
$as_echo "$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
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
$as_echo "$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`
$as_echo "$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"
    $as_echo "$as_me: test suite duration: $at_duration" >&5
    ;;
esac

echo
$as_echo "## ------------- ##
## Test results. ##
## ------------- ##"
echo
{
  echo
  $as_echo "## ------------- ##
## 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
    $as_echo "## ------------------------ ##
## 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
      $as_echo "## ---------------------- ##
## 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
  $as_echo "Please send $at_msg and all information you think might help:

   To: <bug-bison@gnu.org>
   Subject: [GNU Bison 3.0.4] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}

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 'input.at:27' \
  "Invalid options" "                                " 1
at_xfail=no
(
  $as_echo "1. $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
$as_echo "$at_srcdir/input.at:36: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -ferror=caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -ferror=caret input.y" "input.at:36"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:36"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:37: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=error=itemsets input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=error=itemsets input.y" "input.at:37"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:37"
$at_failed && at_fn_log_failure
$at_traceon; }



# We used to accept any character after "-Werror", instead of ensuring
# this is "=".

{ set +x
$as_echo "$at_srcdir/input.at:41: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror?all input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror?all input.y" "input.at:41"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:41"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:50' \
  "Invalid inputs" "                                 " 1
at_xfail=no
(
  $as_echo "2. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
\000\001\002\377?
%%
?
default: 'a' }
%&
%a-does-not-exist
%-
%{
_ATEOF

{ set +x
$as_echo "$at_srcdir/input.at:62: \$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:62"
( $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:62"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:64: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:64"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: invalid characters: '\\0\\001\\002\\377?'
input.y:3.1: error: invalid character: '?'
input.y:4.14: error: invalid character: '}'
input.y:5.1: error: invalid character: '%'
input.y:5.2: error: invalid character: '&'
input.y:6.1-17: error: invalid directive: '%a-does-not-exist'
input.y:7.1: error: invalid character: '%'
input.y:7.2: error: invalid character: '-'
input.y:8.1-9.0: error: missing '%}' at end of file
input.y:8.1-9.0: error: syntax error, unexpected %{...%}
" | \
  $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:64"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:80' \
  "Invalid inputs with {}" "                         " 1
at_xfail=no
(
  $as_echo "3. $at_setup_line: testing $at_desc ..."
  $at_traceon


# We used to SEGV here.  See
# http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html

cat >input.y <<'_ATEOF'

%destructor
%initial-action
%lex-param
%parse-param
%printer
%union
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
" | \
  $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: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_3
#AT_START_4
at_fn_group_banner 4 'input.at:107' \
  "Invalid \$n and @n" "                              " 1
at_xfail=no
(
  $as_echo "4. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
exp: %empty { $$ = $1 ; };
exp: %empty { @$ = @1 ; };
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:115: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:115"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.20-21: error: integer out of range: '\$1'
 exp: %empty { \$\$ = \$1 ; };
                    ^^
input.y:3.20-21: error: integer out of range: '@1'
 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:115"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:131' \
  "Type Clashes" "                                   " 1
at_xfail=no
(
  $as_echo "5. $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
$as_echo "$at_srcdir/input.at:144: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:144"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:5.12-13: error: \$\$ for the midrule at \$2 of 'exp' has no declared type
 exp: foo { \$\$; } foo { \$2; } foo
            ^^
input.y:5.24-25: error: \$2 of 'exp' has no declared type
 exp: foo { \$\$; } foo { \$2; } foo
                        ^^
input.y:5.6-32: warning: type clash on default action: <bar> != <> [-Wother]
 exp: foo { \$\$; } foo { \$2; } foo
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:6.6-8: warning: type clash on default action: <bar> != <> [-Wother]
    | foo
      ^^^
input.y:7.6-11: warning: empty rule for typed nonterminal, and no action [-Wother]
    | %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:144"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:317' \
  "Unused values" "                                  " 1
at_xfail=no
(
  $as_echo "6. $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;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
%%
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; }
;

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; };
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:318: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:318"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:318"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:318: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:318"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:318"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:318: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:318"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:318"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:318: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:318"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:318"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:318: bison -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:318"
( $at_check_trace; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: \$1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: \$3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: \$5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.10-62: warning: unset value: \$\$ [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: \$3 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: \$5 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                                           ^^^
input.y:14.10-49: warning: unset value: \$\$ [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: \$3 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: \$5 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: \$\$ [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: \$3 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                  ^^^
input.y:15.27-29: warning: unused value: \$5 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                           ^^^
input.y:17.10-58: warning: unset value: \$\$ [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: \$1 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^
input.y:17.31-33: warning: unused value: \$3 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                               ^^^
input.y:17.52-54: warning: unused value: \$5 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: \$\$ [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: \$1 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: \$3 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                               ^^^
input.y:18.66-68: warning: unused value: \$5 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                                                                  ^^^
input.y:21.10-68: warning: unset value: \$\$ [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: \$1 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: \$2 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
              ^^^
" | \
  $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:318"
$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
$as_echo "$at_srcdir/input.at:318: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror" "input.at:318"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:318"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:11.10-32: warning: unset value: $$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: $1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: $3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: $5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.10-62: warning: unset value: $$ [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: $3 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: $5 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                                           ^^^
input.y:14.10-49: warning: unset value: $$ [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: $3 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: $5 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: $$ [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: $3 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                  ^^^
input.y:15.27-29: warning: unused value: $5 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                           ^^^
input.y:17.10-58: warning: unset value: $$ [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: $1 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^
input.y:17.31-33: warning: unused value: $3 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                               ^^^
input.y:17.52-54: warning: unused value: $5 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: $$ [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: $1 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: $3 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                               ^^^
input.y:18.66-68: warning: unused value: $5 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                                                                  ^^^
input.y:21.10-68: warning: unset value: $$ [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: $1 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: $2 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
              ^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:318: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:318"
( $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:318"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:318: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error" "input.at:318"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:318"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:318: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror" "input.at:318"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:318"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:318: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror" "input.at:318"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:318"
$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;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
%%
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; }
;

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; };
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:319"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:319"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:319"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:319"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:319: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:319"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:319"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:319: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:319"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:319"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:319: bison -fno-caret --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_trace "input.at:319"
( $at_check_trace; bison -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"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: \$1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: \$3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: \$5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.14-20: warning: unset value: \$\$ [-Wmidrule-values]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
              ^^^^^^^
input.y:13.26-41: warning: unset value: \$\$ [-Wmidrule-values]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                          ^^^^^^^^^^^^^^^^
input.y:13.10-62: warning: unset value: \$\$ [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: \$3 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: \$5 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                                           ^^^
input.y:14.14-16: warning: unset value: \$\$ [-Wmidrule-values]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
              ^^^
input.y:14.10-49: warning: unset value: \$\$ [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: \$3 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: \$5 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: \$\$ [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: \$3 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                  ^^^
input.y:15.27-29: warning: unused value: \$5 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                           ^^^
input.y:17.10-58: warning: unset value: \$\$ [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: \$1 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^
input.y:17.14-29: warning: unused value: \$2 [-Wmidrule-values]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
              ^^^^^^^^^^^^^^^^
input.y:17.31-33: warning: unused value: \$3 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                               ^^^
input.y:17.35-50: warning: unused value: \$4 [-Wmidrule-values]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                                   ^^^^^^^^^^^^^^^^
input.y:17.52-54: warning: unused value: \$5 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: \$\$ [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: \$1 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: \$3 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                               ^^^
input.y:18.35-64: warning: unused value: \$4 [-Wmidrule-values]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.66-68: warning: unused value: \$5 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                                                                  ^^^
input.y:20.18-37: warning: unused value: \$3 [-Wmidrule-values]
 j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
                  ^^^^^^^^^^^^^^^^^^^^
input.y:21.10-68: warning: unset value: \$\$ [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: \$1 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: \$2 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
              ^^^
input.y:21.35-64: warning: unused value: \$4 [-Wmidrule-values]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
" | \
  $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:319"
$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
$as_echo "$at_srcdir/input.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Werror" "input.at:319"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:319"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:11.10-32: warning: unset value: $$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: $1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: $3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: $5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.14-20: warning: unset value: $$ [-Wmidrule-values]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
              ^^^^^^^
input.y:13.26-41: warning: unset value: $$ [-Wmidrule-values]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                          ^^^^^^^^^^^^^^^^
input.y:13.10-62: warning: unset value: $$ [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: $3 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: $5 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                                           ^^^
input.y:14.14-16: warning: unset value: $$ [-Wmidrule-values]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
              ^^^
input.y:14.10-49: warning: unset value: $$ [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: $3 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: $5 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: $$ [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: $3 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                  ^^^
input.y:15.27-29: warning: unused value: $5 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                           ^^^
input.y:17.10-58: warning: unset value: $$ [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: $1 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^
input.y:17.14-29: warning: unused value: $2 [-Wmidrule-values]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
              ^^^^^^^^^^^^^^^^
input.y:17.31-33: warning: unused value: $3 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                               ^^^
input.y:17.35-50: warning: unused value: $4 [-Wmidrule-values]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                                   ^^^^^^^^^^^^^^^^
input.y:17.52-54: warning: unused value: $5 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: $$ [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: $1 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: $3 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                               ^^^
input.y:18.35-64: warning: unused value: $4 [-Wmidrule-values]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.66-68: warning: unused value: $5 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                                                                  ^^^
input.y:20.18-37: warning: unused value: $3 [-Wmidrule-values]
 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
                  ^^^^^^^^^^^^^^^^^^^^
input.y:21.10-68: warning: unset value: $$ [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: $1 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: $2 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
              ^^^
input.y:21.35-64: warning: unused value: $4 [-Wmidrule-values]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:319: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:319"
( $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:319"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:319"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:319"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Wnone -Werror" "input.at:319"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:319"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:319: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror" "input.at:319"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:319"
$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:327' \
  "Unused values before symbol declarations" "       " 1
at_xfail=no
(
  $as_echo "7. $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; }
;

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; };
%token <integer> INT;
%type <integer> a b c d e f g h i j k l;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:328"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:328"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:328: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:328"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:328"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:328: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:328"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:328"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:328: bison -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:328"
( $at_check_trace; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: \$1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: \$3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: \$5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.10-62: warning: unset value: \$\$ [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: \$3 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: \$5 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                                           ^^^
input.y:14.10-49: warning: unset value: \$\$ [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: \$3 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: \$5 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: \$\$ [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: \$3 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                  ^^^
input.y:15.27-29: warning: unused value: \$5 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                           ^^^
input.y:17.10-58: warning: unset value: \$\$ [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: \$1 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^
input.y:17.31-33: warning: unused value: \$3 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                               ^^^
input.y:17.52-54: warning: unused value: \$5 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: \$\$ [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: \$1 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: \$3 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                               ^^^
input.y:18.66-68: warning: unused value: \$5 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                                                                  ^^^
input.y:21.10-68: warning: unset value: \$\$ [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: \$1 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: \$2 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
              ^^^
" | \
  $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:328"
$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
$as_echo "$at_srcdir/input.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror" "input.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:328"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:11.10-32: warning: unset value: $$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: $1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: $3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: $5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.10-62: warning: unset value: $$ [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: $3 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: $5 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                                           ^^^
input.y:14.10-49: warning: unset value: $$ [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: $3 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: $5 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: $$ [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: $3 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                  ^^^
input.y:15.27-29: warning: unused value: $5 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                           ^^^
input.y:17.10-58: warning: unset value: $$ [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: $1 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^
input.y:17.31-33: warning: unused value: $3 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                               ^^^
input.y:17.52-54: warning: unused value: $5 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: $$ [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: $1 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: $3 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                               ^^^
input.y:18.66-68: warning: unused value: $5 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                                                                  ^^^
input.y:21.10-68: warning: unset value: $$ [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: $1 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: $2 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
              ^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:328: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:328"
( $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:328"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error" "input.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:328"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror" "input.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:328"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror" "input.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:328"
$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; }
;

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; };
%token <integer> INT;
%type <integer> a b c d e f g h i j k l;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:329: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:329"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:329: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:329"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:329"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:329: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:329"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:329: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:329"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:329: bison -fno-caret --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_trace "input.at:329"
( $at_check_trace; bison -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"; $as_echo "input.y:11.10-32: warning: unset value: \$\$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: \$1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: \$3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: \$5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.14-20: warning: unset value: \$\$ [-Wmidrule-values]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
              ^^^^^^^
input.y:13.26-41: warning: unset value: \$\$ [-Wmidrule-values]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                          ^^^^^^^^^^^^^^^^
input.y:13.10-62: warning: unset value: \$\$ [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: \$3 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: \$5 [-Wother]
 c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
                                           ^^^
input.y:14.14-16: warning: unset value: \$\$ [-Wmidrule-values]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
              ^^^
input.y:14.10-49: warning: unset value: \$\$ [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: \$3 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: \$5 [-Wother]
 d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: \$\$ [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: \$3 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                  ^^^
input.y:15.27-29: warning: unused value: \$5 [-Wother]
 e: INT | INT { } INT {  } INT { \$1; };
                           ^^^
input.y:17.10-58: warning: unset value: \$\$ [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: \$1 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
          ^^^
input.y:17.14-29: warning: unused value: \$2 [-Wmidrule-values]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
              ^^^^^^^^^^^^^^^^
input.y:17.31-33: warning: unused value: \$3 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                               ^^^
input.y:17.35-50: warning: unused value: \$4 [-Wmidrule-values]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                                   ^^^^^^^^^^^^^^^^
input.y:17.52-54: warning: unused value: \$5 [-Wother]
 g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: \$\$ [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: \$1 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: \$3 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                               ^^^
input.y:18.35-64: warning: unused value: \$4 [-Wmidrule-values]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.66-68: warning: unused value: \$5 [-Wother]
 h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
                                                                  ^^^
input.y:20.18-37: warning: unused value: \$3 [-Wmidrule-values]
 j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
                  ^^^^^^^^^^^^^^^^^^^^
input.y:21.10-68: warning: unset value: \$\$ [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: \$1 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: \$2 [-Wother]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
              ^^^
input.y:21.35-64: warning: unused value: \$4 [-Wmidrule-values]
 k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
" | \
  $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:329"
$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
$as_echo "$at_srcdir/input.at:329: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Werror" "input.at:329"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:329"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:11.10-32: warning: unset value: $$ [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^
input.y:11.10-12: warning: unused value: $1 [-Wother]
 a: INT | INT { } INT { } INT { };
          ^^^
input.y:11.18-20: warning: unused value: $3 [-Wother]
 a: INT | INT { } INT { } INT { };
                  ^^^
input.y:11.26-28: warning: unused value: $5 [-Wother]
 a: INT | INT { } INT { } INT { };
                          ^^^
input.y:12.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
 b: INT | %empty;
          ^^^^^^
input.y:13.14-20: warning: unset value: $$ [-Wmidrule-values]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
              ^^^^^^^
input.y:13.26-41: warning: unset value: $$ [-Wmidrule-values]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                          ^^^^^^^^^^^^^^^^
input.y:13.10-62: warning: unset value: $$ [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:13.22-24: warning: unused value: $3 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                      ^^^
input.y:13.43-45: warning: unused value: $5 [-Wother]
 c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
                                           ^^^
input.y:14.14-16: warning: unset value: $$ [-Wmidrule-values]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
              ^^^
input.y:14.10-49: warning: unset value: $$ [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:14.18-20: warning: unused value: $3 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                  ^^^
input.y:14.30-32: warning: unused value: $5 [-Wother]
 d: INT | INT { } INT { $1; } INT { $<integer>2; };
                              ^^^
input.y:15.10-37: warning: unset value: $$ [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:15.18-20: warning: unused value: $3 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                  ^^^
input.y:15.27-29: warning: unused value: $5 [-Wother]
 e: INT | INT { } INT {  } INT { $1; };
                           ^^^
input.y:17.10-58: warning: unset value: $$ [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:17.10-12: warning: unused value: $1 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
          ^^^
input.y:17.14-29: warning: unused value: $2 [-Wmidrule-values]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
              ^^^^^^^^^^^^^^^^
input.y:17.31-33: warning: unused value: $3 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                               ^^^
input.y:17.35-50: warning: unused value: $4 [-Wmidrule-values]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                                   ^^^^^^^^^^^^^^^^
input.y:17.52-54: warning: unused value: $5 [-Wother]
 g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
                                                    ^^^
input.y:18.10-72: warning: unset value: $$ [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.10-12: warning: unused value: $1 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
          ^^^
input.y:18.31-33: warning: unused value: $3 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                               ^^^
input.y:18.35-64: warning: unused value: $4 [-Wmidrule-values]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:18.66-68: warning: unused value: $5 [-Wother]
 h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
                                                                  ^^^
input.y:20.18-37: warning: unused value: $3 [-Wmidrule-values]
 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
                  ^^^^^^^^^^^^^^^^^^^^
input.y:21.10-68: warning: unset value: $$ [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:21.10-12: warning: unused value: $1 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
          ^^^
input.y:21.14-16: warning: unused value: $2 [-Wother]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
              ^^^
input.y:21.35-64: warning: unused value: $4 [-Wmidrule-values]
 k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:329: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:329"
( $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:329"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:329: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:329"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:329"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:329: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Wnone -Werror" "input.at:329"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:329: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror" "input.at:329"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:329"
$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:337' \
  "Default %printer and %destructor redeclared" "    " 1
at_xfail=no
(
  $as_echo "8. $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
$as_echo "$at_srcdir/input.at:397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:397"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: %destructor redeclaration for <>
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:1.13-29:     previous declaration
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:2.10-24: error: %printer redeclaration for <>
 %printer { print (\$\$); } <> <>
          ^^^^^^^^^^^^^^^
input.y:2.10-24:     previous declaration
 %printer { print (\$\$); } <> <>
          ^^^^^^^^^^^^^^^
input.y:4.13-29: error: %destructor redeclaration for <>
 %destructor { destroy (\$\$); } <>
             ^^^^^^^^^^^^^^^^^
input.y:1.13-29:     previous declaration
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:5.10-24: error: %printer redeclaration for <>
 %printer { print (\$\$); } <>
          ^^^^^^^^^^^^^^^
input.y:2.10-24:     previous declaration
 %printer { print (\$\$); } <> <>
          ^^^^^^^^^^^^^^^
input.y:11.13-29: error: %destructor redeclaration for <>
 %destructor { destroy (\$\$); } <>;
             ^^^^^^^^^^^^^^^^^
input.y:1.13-29:      previous declaration
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:12.10-24: error: %printer redeclaration for <>
 %printer { print (\$\$); } <>;
          ^^^^^^^^^^^^^^^
input.y:2.10-24:      previous declaration
 %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:397"
$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
$as_echo "$at_srcdir/input.at:398: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:398"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: %destructor redeclaration for <>
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:1.13-29:     previous declaration
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:2.10-24: error: %printer redeclaration for <>
 %printer { print (\$\$); } <> <>
          ^^^^^^^^^^^^^^^
input.y:2.10-24:     previous declaration
 %printer { print (\$\$); } <> <>
          ^^^^^^^^^^^^^^^
input.y:4.13-29: error: %destructor redeclaration for <>
 %destructor { destroy (\$\$); } <>
             ^^^^^^^^^^^^^^^^^
input.y:1.13-29:     previous declaration
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:5.10-24: error: %printer redeclaration for <>
 %printer { print (\$\$); } <>
          ^^^^^^^^^^^^^^^
input.y:2.10-24:     previous declaration
 %printer { print (\$\$); } <> <>
          ^^^^^^^^^^^^^^^
input.y:11.13-29: error: %destructor redeclaration for <>
 %destructor { destroy (\$\$); } <>;
             ^^^^^^^^^^^^^^^^^
input.y:1.13-29:      previous declaration
 %destructor { destroy (\$\$); } <> <>
             ^^^^^^^^^^^^^^^^^
input.y:12.10-24: error: %printer redeclaration for <>
 %printer { print (\$\$); } <>;
          ^^^^^^^^^^^^^^^
input.y:2.10-24:      previous declaration
 %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:398"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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:408' \
  "Per-type %printer and %destructor redeclared" "   " 1
at_xfail=no
(
  $as_echo "9. $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
$as_echo "$at_srcdir/input.at:425: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:425"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:4.13-29: error: %destructor redeclaration for <field1>
input.y:1.13-29:     previous declaration
input.y:4.13-29: error: %destructor redeclaration for <field1>
input.y:1.13-29:     previous declaration
input.y:5.10-24: error: %printer redeclaration for <field2>
input.y:2.10-24:     previous declaration
input.y:5.10-24: error: %printer redeclaration for <field2>
input.y:2.10-24:     previous declaration
input.y:11.13-29: error: %destructor redeclaration for <field2>
input.y:1.13-29:      previous declaration
input.y:11.13-29: error: %destructor redeclaration for <field1>
input.y:1.13-29:      previous declaration
input.y:12.10-24: error: %printer redeclaration for <field2>
input.y:2.10-24:      previous declaration
input.y:12.10-24: error: %printer redeclaration for <field1>
input.y:2.10-24:      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:425"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:450' \
  "Undefined symbols" "                              " 1
at_xfail=no
(
  $as_echo "10. $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
$as_echo "$at_srcdir/input.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.16-18: error: symbol bar is used, but is not defined as a token and has no rules
 %destructor {} bar
                ^^^
input.y:1.17-19: warning: symbol baz is used, but is not defined as a token and has no rules [-Wother]
 %printer {} foo baz
                 ^^^
input.y:1.13-15: warning: symbol foo is used, but is not defined as a token and has no rules [-Wother]
 %printer {} foo baz
             ^^^
input.y:3.13-15: warning: symbol qux is used, but is not defined as a token and has no rules [-Wother]
 %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:460"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:482' \
  "Unassociated types used for a printer or destructor" "" 1
at_xfail=no
(
  $as_echo "11. $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
$as_echo "$at_srcdir/input.at:499: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:499"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:499"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:499: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:499"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:499"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:499: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:499"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:499"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:499: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:499"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:499"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:499: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:499"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:499"
$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
$as_echo "$at_srcdir/input.at:499: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:499"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:499"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:499: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:499"
( $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:499"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:499: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:499"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:499"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:499: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:499"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:499"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:499: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:499"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:499"
$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:511' \
  "Useless printers or destructors" "                " 1
at_xfail=no
(
  $as_echo "12. $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
$as_echo "$at_srcdir/input.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:522: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:522"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:522"
$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
$as_echo "$at_srcdir/input.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:522"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:522: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:522"
( $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:522"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:522"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:522"
$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
$as_echo "$at_srcdir/input.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:553: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:553"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:553: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:553"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:553: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:553"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:553"
$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
$as_echo "$at_srcdir/input.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:553: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:553"
( $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:553"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$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
$as_echo "$at_srcdir/input.at:561: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:561"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:561: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:561"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:561"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:561: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:561"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:561: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:561"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:561: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:561"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:561"
$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
$as_echo "$at_srcdir/input.at:561: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:561"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:561"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:561: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:561"
( $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:561"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:561: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:561"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:561"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:561: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:561"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:561: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:561"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:561"
$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_12
#AT_START_13
at_fn_group_banner 13 'input.at:576' \
  "Unused values with default %destructor" "         " 1
at_xfail=no
(
  $as_echo "13. $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
$as_echo "$at_srcdir/input.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:589"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:589"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:589"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:589: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:589"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:589: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:589"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:589: bison -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:589"
( $at_check_trace; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unset value: \$\$ [-Wother]
 start: end end tagged tagged { \$<tag>1; \$3; } ;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:6.12-14: warning: unused value: \$2 [-Wother]
 start: end end tagged tagged { \$<tag>1; \$3; } ;
            ^^^
input.y:7.6-8: warning: unset value: \$\$ [-Wother]
 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:589"
$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
$as_echo "$at_srcdir/input.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror" "input.at:589"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:589"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
 start: end end tagged tagged { $<tag>1; $3; } ;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:6.12-14: warning: unused value: $2 [-Wother]
 start: end end tagged tagged { $<tag>1; $3; } ;
            ^^^
input.y:7.6-8: warning: unset value: $$ [-Wother]
 end: { } ;
      ^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:589: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:589"
( $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:589"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error" "input.at:589"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:589"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror" "input.at:589"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:589: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror" "input.at:589"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:589"
$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
$as_echo "$at_srcdir/input.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:612"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:612: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:612"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:612: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:612"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:612: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:612"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:612"
$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
$as_echo "$at_srcdir/input.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:612"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:612: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:612"
( $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:612"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:612"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:612"
$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_13
#AT_START_14
at_fn_group_banner 14 'input.at:624' \
  "Unused values with per-type %destructor" "        " 1
at_xfail=no
(
  $as_echo "14. $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
$as_echo "$at_srcdir/input.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:636: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:636"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:636: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:636"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:636: bison -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:636"
( $at_check_trace; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:6.8-22: warning: unset value: \$\$ [-Wother]
 start: end end { \$1; } ;
        ^^^^^^^^^^^^^^^
input.y:6.12-14: warning: unused value: \$2 [-Wother]
 start: end end { \$1; } ;
            ^^^
input.y:7.6-8: warning: unset value: \$\$ [-Wother]
 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:636"
$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
$as_echo "$at_srcdir/input.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror" "input.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
 start: end end { $1; } ;
        ^^^^^^^^^^^^^^^
input.y:6.12-14: warning: unused value: $2 [-Wother]
 start: end end { $1; } ;
            ^^^
input.y:7.6-8: warning: unset value: $$ [-Wother]
 end: { }  ;
      ^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:636: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:636"
( $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:636"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error" "input.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror" "input.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror" "input.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:636"
$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_14
#AT_START_15
at_fn_group_banner 15 'input.at:655' \
  "Incompatible Aliases" "                           " 1
at_xfail=no
(
  $as_echo "15. $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
$as_echo "$at_srcdir/input.at:665: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:665"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.7-11: error: %type redeclaration for foo
 %type <baz> foo
       ^^^^^
input.y:2.7-11:     previous declaration
 %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:665"
$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
$as_echo "$at_srcdir/input.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:679"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.10-14: error: %printer redeclaration for foo
 %printer {baz} foo
          ^^^^^
input.y:2.10-14:     previous declaration
 %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:679"
$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
$as_echo "$at_srcdir/input.at:693: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:693"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.13-17: error: %destructor redeclaration for foo
 %destructor {baz} foo
             ^^^^^
input.y:2.13-17:     previous declaration
 %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:693"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%token foo "foo"
%left "foo"
%left foo
%%
exp: foo;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:707"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.1-5: error: %left redeclaration for foo
 %left foo
 ^^^^^
input.y:2.1-5:     previous declaration
 %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:707"
$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
$as_echo "$at_srcdir/input.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.1-5: error: %left redeclaration for foo
 %left foo
 ^^^^^
input.y:1.1-5:     previous declaration
 %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:724"
$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
$as_echo "$at_srcdir/input.at:739: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:739"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.10-11: error: %printer redeclaration for foo
 %printer {} foo
          ^^
input.y:1.10-11:     previous declaration
 %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:739"
$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
$as_echo "$at_srcdir/input.at:754: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:754"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.13-14: error: %destructor redeclaration for foo
 %destructor {} foo
             ^^
input.y:1.13-14:     previous declaration
 %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: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_15
#AT_START_16
at_fn_group_banner 16 'input.at:780' \
  "Torturing the Scanner" "                          " 1
at_xfail=no
(
  $as_echo "16. $at_setup_line: testing $at_desc ..."
  $at_traceon



: >input.y

{ set +x
$as_echo "$at_srcdir/input.at:784: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:784"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.1: error: 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/input.at:784"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
{}
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:792: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret  input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret  input.y" "input.at:792"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret  input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: syntax error, unexpected {...}
 {}
 ^^
" | \
  $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:792"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
/* 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>

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"

%%
/* 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static char const input[] = "[\1\2$@{@oline@__oline__\
#output "; /* "
  */
  static size_t toknum;
  assert (toknum < sizeof input);
  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
$as_echo "$at_srcdir/input.at:920: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:920"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:920"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:920: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "input.at:920"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:920"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:920: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:920"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:920"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:920: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:920"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:920"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:920: bison -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "input.at:920"
( $at_check_trace; bison -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:920"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/input.at:921: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:921"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:921"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:921: \$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:921"
( $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:921"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:922: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:922"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:922"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:922: \$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:922"
( $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:922"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:923: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:923"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:923"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:923: \$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:923"
( $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:923"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:924:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:924"
( $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"; $as_echo "[[],
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:924"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:924: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "input.at:924"
( $at_check_trace; 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:924"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:935' \
  "Typed symbol aliases" "                           " 1
at_xfail=no
(
  $as_echo "17. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Bison 2.0 broke typed symbol aliases - ensure they work.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/input.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:951"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:951"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:951"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:951"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:951: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:951"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:951"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:951: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:951"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:951"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:951: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:951"
( $at_check_trace; bison -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:951"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:971' \
  "Require 1.0" "                                    " 1
at_xfail=no
(
  $as_echo "18. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/input.at:971: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:971"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:971"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:971: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:971"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:971"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:971: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:971"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:971"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:971: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:971"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:971"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:971: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:971"
( $at_check_trace; bison -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:971"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:972' \
  "Require 3.0.4" "                                  " 1
at_xfail=no
(
  $as_echo "19. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%require "3.0.4";
%%
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
$as_echo "$at_srcdir/input.at:972: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:972"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:972"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:972: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:972"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:972"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:972: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:972"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:972"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:972: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:972"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:972"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:972: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:972"
( $at_check_trace; bison -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:972"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:974' \
  "Require 100.0" "                                  " 1
at_xfail=no
(
  $as_echo "20. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%require "100.0";
%%
empty_file: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y" "input.at:974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:974"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:981' \
  "String aliases for character tokens" "            " 1
at_xfail=no
(
  $as_echo "21. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Bison once thought a character token and its alias were different
# symbols with the same user token number.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/input.at:993: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:993"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:993"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:993: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:993"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:993"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:993: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:993"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:993"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:993: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:993"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:993"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:993: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:993"
( $at_check_trace; bison -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:993"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1002' \
  "Symbols" "                                        " 1
at_xfail=no
(
  $as_echo "22. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%token WITH-DASH
%token WITHOUT_DASH "WITHOUT-DASH"
%token WITH.PERIOD
%token WITHOUT_PERIOD "WITHOUT.PERIOD"
%code {
  #include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
_ATEOF




# POSIX Yacc accept periods, but not dashes.

{ set +x
$as_echo "$at_srcdir/input.at:1027: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --yacc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --yacc input.y" "input.at:1027"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --yacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:9.8-16: error: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Werror=yacc]
input.y:20.8-16: error: POSIX Yacc forbids dashes in symbol names: with-dash [-Werror=yacc]
" | \
  $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:1027"
$at_failed && at_fn_log_failure
$at_traceon; }



# 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
$as_echo "$at_srcdir/input.at:1033: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1033"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1033"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1033: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1033"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1033"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1033: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1033"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1033"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1033: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1033"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1033"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1033: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1033"
( $at_check_trace; bison -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:1033"
$at_failed && at_fn_log_failure
$at_traceon; }



# Make sure we don't export silly token identifiers with periods or dashes.
{ set +x
$as_echo "$at_srcdir/input.at:1036: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:1036"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1036"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:1036: \$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:1036"
( $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:1036"
$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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%token .GOOD
         -GOOD
         1NV4L1D
         -123
%%
start: .GOOD GOOD
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1049: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y" "input.at:1049"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1049"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1062' \
  "Numbered tokens" "                                " 1
at_xfail=no
(
  $as_echo "23. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >redecl.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%token DECIMAL_1     11259375
         HEXADECIMAL_1 0xabcdef
         HEXADECIMAL_2 0xFEDCBA
         DECIMAL_2     16702650
%%
start: DECIMAL_1 HEXADECIMAL_2;
_ATEOF




{ set +x
$as_echo "$at_srcdir/input.at:1073: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret redecl.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret redecl.y" "input.at:1073"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret redecl.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "redecl.y:10.10-22: error: user token number 11259375 redeclaration for HEXADECIMAL_1
redecl.y:9.8-16:       previous declaration for DECIMAL_1
redecl.y:12.10-18: error: user token number 16702650 redeclaration for DECIMAL_2
redecl.y:11.10-22:     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:1073"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >too-large.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%token TOO_LARGE_DEC 999999999999999999999
         TOO_LARGE_HEX 0xFFFFFFFFFFFFFFFFFFF
%%
start: TOO_LARGE_DEC TOO_LARGE_HEX
%%
_ATEOF




{ set +x
$as_echo "$at_srcdir/input.at:1088: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret too-large.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret too-large.y" "input.at:1088"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret too-large.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "too-large.y:9.22-42: error: integer out of range: '999999999999999999999'
too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF'
" | \
  $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:1088"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1100' \
  "Unclosed constructs" "                            " 1
at_xfail=no
(
  $as_echo "24. $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
$as_echo "$at_srcdir/input.at:1129: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y" "input.at:1129"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line
 %token A \"a
          ^^
input.y:4.10-5.0: error: missing \"'\" at end of line
 %token C '1
          ^^
input.y:14.11-15.0: error: missing \"'\" at end of line
 %type <f> 'a
           ^^
input.y:16.11-17.0: error: missing '\"' at end of line
 %type <f> \"a
           ^^
input.y:19.13-20.0: error: missing '}' at end of file
 %destructor { free (\$\$)
             ^^^^^^^^^^^
input.y:20.1: error: 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/input.at:1129"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1155' \
  "%start after first rule" "                        " 1
at_xfail=no
(
  $as_echo "25. $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
$as_echo "$at_srcdir/input.at:1167: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1167"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1167"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1167: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1167"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1167"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1167: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1167"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1167"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1167: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1167"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1167"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1167: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1167"
( $at_check_trace; bison -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:1167"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1176' \
  "%prec takes a token" "                            " 1
at_xfail=no
(
  $as_echo "26. $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
$as_echo "$at_srcdir/input.at:1186: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1186"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1186"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1197' \
  "%prec's token must be defined" "                  " 1
at_xfail=no
(
  $as_echo "27. $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
$as_echo "$at_srcdir/input.at:1206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1206: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1206"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1206: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1206"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1206: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1206"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1206"
$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
$as_echo "$at_srcdir/input.at:1206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:1206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1206: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1206"
( $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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:1206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:1206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1206"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:1206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1206"
$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:1217' \
  "Reject unused %code qualifiers" "                 " 1
at_xfail=no
(
  $as_echo "28. $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
$as_echo "$at_srcdir/input.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c.y" "input.at:1227"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-c.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1227"
$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
$as_echo "$at_srcdir/input.at:1241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c-glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c-glr.y" "input.at:1241"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-c-glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1241"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input-c++.y <<'_ATEOF'
%code q {}
%code bad {}
 %code q {}
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1254: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c++.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c++.y" "input.at:1254"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-c++.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1254"
$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
$as_echo "$at_srcdir/input.at:1267: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c++-glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-c++-glr.y" "input.at:1267"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-c++-glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1267"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >special-char-@@.y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1280: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret special-char-@@.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret special-char-@@.y" "input.at:1280"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret special-char-@@.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1280"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >special-char-].y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1293: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret special-char-].y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret special-char-].y" "input.at:1293"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret special-char-].y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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: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_28
#AT_START_29
at_fn_group_banner 29 'input.at:1306' \
  "Multiple %code" "                                 " 1
at_xfail=no
(
  $as_echo "29. $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>

static void yyerror (const char *msg);
  static int yylex (void);
}
%%
start: %empty;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/input.at:1335: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1335"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1335: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1335"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1335: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1335"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1335: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1335"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1335: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1335"
( $at_check_trace; bison -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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/input.at:1335: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "input.at:1335"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:1335: \$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:1335"
( $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:1335"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:1336:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:1336"
( $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:1336"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "input.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
at_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:1336"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:1345' \
  "errors" "                                         " 1
at_xfail=no
(
  $as_echo "30. $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
$as_echo "$at_srcdir/input.at:1357: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-redefined.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-redefined.y" "input.at:1357"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-redefined.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-redefined.y:2.9-11: error: %define variable 'var' redefined
input-redefined.y:1.9-11:     previous definition
input-redefined.y:3.10-12: error: %define variable 'var' redefined
input-redefined.y:2.9-11:      previous definition
" | \
  $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:1357"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input-unused.y <<'_ATEOF'
%define var "value"
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1370: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-unused.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-unused.y" "input.at:1370"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-unused.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-unused.y:1.9-11: 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:1370"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1381' \
  "%define, --define, --force-define" "              " 1
at_xfail=no
(
  $as_echo "31. $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
$as_echo "$at_srcdir/input.at:1397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -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:1397"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1397"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1397: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -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:1397"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1397"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1397: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1397"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1397"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1397: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1397"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1397"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1397: bison -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:1397"
( $at_check_trace; bison -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:1397"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/input.at:1402: cat input.tab.c"
at_fn_check_prepare_trace "input.at:1402"
( $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"; $as_echo "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:1402"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input-dg.y <<'_ATEOF'
%define var "gram"
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1414: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dvar=cmd-d input-dg.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dvar=cmd-d input-dg.y" "input.at:1414"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "input-dg.y:1.9-11: error: %define variable 'var' redefined
<command line>:2:      previous definition
" | \
  $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:1414"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input-dg.y <<'_ATEOF'
%define var "gram"
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1424: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Dvar=cmd-d input-dg.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Dvar=cmd-d input-dg.y" "input.at:1424"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "input-dg.y:1.9-11: error: %define variable 'var' redefined
 %define var \"gram\"
         ^^^
<command line>:3:      previous definition
" | \
  $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:1424"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input-unused.y <<'_ATEOF'
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1435: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dunused-d -Funused-f input-unused.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dunused-d -Funused-f input-unused.y" "input.at:1435"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "<command line>:2: error: %define variable 'unused-d' is not used
<command line>:3: 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:1435"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1446' \
  "\"%define\" Boolean variables" "                    " 1
at_xfail=no
(
  $as_echo "32. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >Input.y <<'_ATEOF'
%language "Java"
%define public maybe
%define parser_class_name {Input}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1456: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret Input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret Input.y" "input.at:1456"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret Input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Input.y:2.9-14: error: invalid value for %define Boolean variable '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:1456"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1466' \
  "\"%define\" code variables" "                       " 1
at_xfail=no
(
  $as_echo "33. $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
$as_echo "$at_srcdir/input.at:1488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.yy" "input.at:1488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1488: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1488"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1488: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1488"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1488: bison -fno-caret input.yy"
at_fn_check_prepare_trace "input.at:1488"
( $at_check_trace; bison -fno-caret input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.yy:2.9-25: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.9-18: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.9-24: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.9-21: 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:1488"
$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
$as_echo "$at_srcdir/input.at:1488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Werror" "input.at:1488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.yy:2.9-25: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.9-18: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.9-24: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.9-21: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1488: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1488"
( $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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=error" "input.at:1488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Wnone -Werror" "input.at:1488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.yy -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1488"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=none -Werror" "input.at:1488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1488"
$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
$as_echo "$at_srcdir/input.at:1489: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1489"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1489: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.yy" "input.at:1489"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1489: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1489"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1489: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1489"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1489: bison -fno-caret input.yy"
at_fn_check_prepare_trace "input.at:1489"
( $at_check_trace; bison -fno-caret input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.yy:2.9-25: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.9-18: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.9-24: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.9-21: 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:1489"
$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
$as_echo "$at_srcdir/input.at:1489: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Werror" "input.at:1489"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.yy:2.9-25: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.9-18: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.9-24: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.9-21: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1489: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1489"
( $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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1489: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=error" "input.at:1489"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1489: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy -Wnone -Werror" "input.at:1489"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.yy -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1489"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1489: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=none -Werror" "input.at:1489"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.yy --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1489"
$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_33
#AT_START_34
at_fn_group_banner 34 'input.at:1499' \
  "\"%define\" keyword variables" "                    " 1
at_xfail=no
(
  $as_echo "34. $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
$as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1521"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1521"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1521: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1521"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1521: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1521"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1521: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1521"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:5.9-15: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.9-28: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.9-33: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:2.9-21: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
input.y:1.9-16: warning: %define variable 'api.pure' 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:1521"
$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
$as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:1521"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:5.9-15: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.9-28: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.9-33: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:2.9-21: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
input.y:1.9-16: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1521: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1521"
( $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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:1521"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:1521"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1521: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:1521"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1521"
$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
$as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1522: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1522"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:5.9-15: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.9-28: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.9-33: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:2.9-21: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
input.y:1.9-16: warning: %define variable 'api.pure' 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:1522"
$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
$as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:1522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:5.9-15: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.9-28: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.9-33: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:2.9-21: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
input.y:1.9-16: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1522: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1522"
( $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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:1522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:1522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:1522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1522"
$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_34
#AT_START_35
at_fn_group_banner 35 'input.at:1532' \
  "\"%define\" enum variables" "                       " 1
at_xfail=no
(
  $as_echo "35. $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
$as_echo "$at_srcdir/input.at:1544: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:1544"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-28: error: invalid value for %define variable 'lr.default-reduction': 'bogus'
 %define lr.default-reduction bogus
         ^^^^^^^^^^^^^^^^^^^^
input.y:1.9-28:     accepted value: 'most'
input.y:1.9-28:     accepted value: 'consistent'
input.y:1.9-28:     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:1544"
$at_failed && at_fn_log_failure
$at_traceon; }



# Back-end.
cat >input.y <<'_ATEOF'
%define api.push-pull neither
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:1559"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
 %define api.push-pull neither
         ^^^^^^^^^^^^^
input.y:1.9-21:     accepted value: 'pull'
input.y:1.9-21:     accepted value: 'push'
input.y:1.9-21:     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:1559"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1574' \
  "\"%define\" backward compatibility" "               " 1
at_xfail=no
(
  $as_echo "36. $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 api.namespace {foo}
%define variant
%%
start: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1586: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y" "input.at:1586"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-21: warning: deprecated directive, use '%define api.push-pull both' [-Wdeprecated]
 %define api.push_pull both
         ^^^^^^^^^^^^^
input.y:2.9-34: warning: deprecated directive, use '%define lr.keep-unreachable-state maybe' [-Wdeprecated]
 %define lr.keep_unreachable_states maybe
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
input.y:3.9-17: warning: deprecated directive, use '%define api.namespace foo' [-Wdeprecated]
 %define namespace \"foo\"
         ^^^^^^^^^
input.y:4.9-21: error: %define variable 'api.namespace' redefined
 %define api.namespace {foo}
         ^^^^^^^^^^^^^
input.y:3.9-17:     previous definition
 %define namespace \"foo\"
         ^^^^^^^^^
input.y:5.9-15: warning: deprecated directive, use '%define api.value.type variant' [-Wdeprecated]
 %define variant
         ^^^^^^^
" | \
  $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: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_36
#AT_START_37
at_fn_group_banner 37 'input.at:1613' \
  "Unused api.pure" "                                " 1
at_xfail=no
(
  $as_echo "37. $at_setup_line: testing $at_desc ..."
  $at_traceon


# AT_CHECK_API_PURE(DECLS, VALUE)
# -------------------------------
# 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
$as_echo "$at_srcdir/input.at:1633: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1633"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-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:1633"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%define api.pure false
%language "c++"
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1634: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1634"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-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:1634"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%define api.pure ""
%language "c++" %glr-parser
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1635: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1635"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-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:1635"
$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
$as_echo "$at_srcdir/input.at:1636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-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:1636"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%define api.pure true
%language "java"
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1637: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1637"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-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:1637"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%define api.pure false
%language "java"
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1638: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1638"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-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:1638"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:1646' \
  "C++ namespace reference errors" "                 " 1
at_xfail=no
(
  $as_echo "38. $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++"
%defines
%define api.namespace {}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1667: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1667"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1667"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace { 		  	 	}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1669: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1669"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1669"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {foo::::bar}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1671: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1671"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1671"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {foo:: 	::bar}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1673: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1673"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1673"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {::::bar}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1675"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {:: ::bar}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1677: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1677"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1677"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {foo::bar::	::}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1679"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: error: namespace reference has consecutive \"::\"
input.y:3.9-21: 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:1679"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {foo::bar::}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1682"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1682"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {foo::bar:: 	}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1684: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1684"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1684"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define api.namespace {::}
%%
start: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1686: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1686"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-21: 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:1686"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:1702' \
  "Bad character literals" "                         " 1
at_xfail=no
(
  $as_echo "39. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >empty.y <<'_ATEOF'
%%
start: '';
start: '
_ATEOF

{ set +x
$as_echo "$at_srcdir/input.at:1709: \$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77"
at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'';\" >> empty.y || exit 77" "input.at:1709"
( $at_check_trace; $PERL -e "print 'start: \'';" >> empty.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:1709"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:1711: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret empty.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret empty.y" "input.at:1711"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret empty.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "empty.y:2.8-9: warning: empty character literal [-Wother]
 start: '';
        ^^
empty.y:3.8-4.0: error: missing \"'\" at end of line
 start: '
        ^
empty.y:3.8-4.0: warning: empty character literal [-Wother]
 start: '
        ^
empty.y:4.8: error: missing \"'\" at end of file
 start: '
        ^
empty.y:4.8: warning: empty character literal [-Wother]
 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:1711"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >two.y <<'_ATEOF'
%%
start: 'ab';
start: 'ab
_ATEOF

{ set +x
$as_echo "$at_srcdir/input.at:1734: \$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77"
at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'ab';\" >> two.y || exit 77" "input.at:1734"
( $at_check_trace; $PERL -e "print 'start: \'ab';" >> two.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:1734"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:1736: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret two.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret two.y" "input.at:1736"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret two.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "two.y:2.8-11: warning: extra characters in character literal [-Wother]
two.y:3.8-4.0: error: missing \"'\" at end of line
two.y:3.8-4.0: warning: extra characters in character literal [-Wother]
two.y:4.8-10: error: missing \"'\" at end of file
two.y:4.8-10: warning: extra characters in character literal [-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:1736"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >three.y <<'_ATEOF'
%%
start: 'abc';
start: 'abc
_ATEOF

{ set +x
$as_echo "$at_srcdir/input.at:1749: \$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77"
at_fn_check_prepare_dynamic "$PERL -e \"print 'start: \\'abc';\" >> three.y || exit 77" "input.at:1749"
( $at_check_trace; $PERL -e "print 'start: \'abc';" >> three.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:1749"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:1751: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret three.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret three.y" "input.at:1751"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret three.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "three.y:2.8-12: warning: extra characters in character literal [-Wother]
three.y:3.8-4.0: error: missing \"'\" at end of line
three.y:3.8-4.0: warning: extra characters in character literal [-Wother]
three.y:4.8-11: error: missing \"'\" at end of file
three.y:4.8-11: warning: extra characters in character literal [-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:1751"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1765' \
  "Bad escapes in literals" "                        " 1
at_xfail=no
(
  $as_echo "40. $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
$as_echo "$at_srcdir/input.at:1778: \$PERL -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y \\
           || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1778"
( $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:1778"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:1781: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1781"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-12: error: invalid number after \\-escape: 777
input.y:2.8-13: warning: empty character literal [-Wother]
input.y:2.16-17: error: invalid number after \\-escape: 0
input.y:2.15-18: warning: empty character literal [-Wother]
input.y:2.21-25: error: invalid number after \\-escape: xfff
input.y:2.20-26: warning: empty character literal [-Wother]
input.y:2.29-31: error: invalid number after \\-escape: x0
input.y:2.28-32: warning: empty character literal [-Wother]
input.y:3.9-14: error: invalid number after \\-escape: uffff
input.y:3.8-15: warning: empty character literal [-Wother]
input.y:3.18-23: error: invalid number after \\-escape: u0000
input.y:3.17-24: warning: empty character literal [-Wother]
input.y:3.27-36: error: invalid number after \\-escape: Uffffffff
input.y:3.26-37: warning: empty character literal [-Wother]
input.y:3.40-49: error: invalid number after \\-escape: U00000000
input.y:3.39-50: warning: empty character literal [-Wother]
input.y:4.9-10: error: invalid character after \\-escape: ' '
input.y:4.8-11: warning: empty character literal [-Wother]
input.y:4.14-15: error: invalid character after \\-escape: A
input.y:4.13-16: warning: empty character literal [-Wother]
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:1781"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1814' \
  "LAC: Errors for %define" "                        " 1
at_xfail=no
(
  $as_echo "41. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
start: %empty;
_ATEOF


# parse.lac.* options are useless if LAC isn't actually activated.

{ set +x
$as_echo "$at_srcdir/input.at:1822: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac.es-capacity-initial=1 input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac.es-capacity-initial=1 input.y" "input.at:1822"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac.es-capacity-initial=1 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "<command line>:2: error: %define variable 'parse.lac.es-capacity-initial' 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:1822"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:1826: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac.memory-trace=full input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac.memory-trace=full input.y" "input.at:1826"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac.memory-trace=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "<command line>:2: 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:1826"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1837' \
  "-Werror combinations" "                           " 1
at_xfail=no
(
  $as_echo "42. $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
$as_echo "$at_srcdir/input.at:1845: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1845"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1845: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall input.y" "input.at:1845"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1845: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1845"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1845: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1845"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1845: bison -fno-caret -Wall input.y"
at_fn_check_prepare_trace "input.at:1845"
( $at_check_trace; bison -fno-caret -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1845"
$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
$as_echo "$at_srcdir/input.at:1845: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Werror" "input.at:1845"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1845: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1845"
( $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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1845: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=error" "input.at:1845"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1845: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Wnone -Werror" "input.at:1845"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1845"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1845: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=none -Werror" "input.at:1845"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1845"
$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
$as_echo "$at_srcdir/input.at:1848: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -W input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1848"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1848: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -W input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -W input.y" "input.at:1848"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1848: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1848"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1848: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1848"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1848: bison -fno-caret -W input.y"
at_fn_check_prepare_trace "input.at:1848"
( $at_check_trace; bison -fno-caret -W input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1848"
$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
$as_echo "$at_srcdir/input.at:1848: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y -Werror" "input.at:1848"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1848: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1848"
( $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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1848: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y --warnings=error" "input.at:1848"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1848: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y -Wnone -Werror" "input.at:1848"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -W input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1848"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1848: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -W input.y --warnings=none -Werror" "input.at:1848"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -W input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1848"
$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
$as_echo "$at_srcdir/input.at:1851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wno-none input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-none input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-none input.y" "input.at:1851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1851: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1851"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1851: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1851"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1851: bison -fno-caret -Wno-none input.y"
at_fn_check_prepare_trace "input.at:1851"
( $at_check_trace; bison -fno-caret -Wno-none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1851"
$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
$as_echo "$at_srcdir/input.at:1851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y -Werror" "input.at:1851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1851: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1851"
( $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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y --warnings=error" "input.at:1851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y -Wnone -Werror" "input.at:1851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y --warnings=none -Werror" "input.at:1851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wno-none input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1851"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

# -Werror is not disabled by -Wnone or equivalent.

{ set +x
$as_echo "$at_srcdir/input.at:1856: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror,none,other input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror,none,other input.y" "input.at:1856"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Werror,none,other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1856"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:1859: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror,no-all,other input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror,no-all,other input.y" "input.at:1859"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "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:1859"
$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
$as_echo "$at_srcdir/input.at:1864: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Werror -Wno-error=other input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1864"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1864"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1864: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y" "input.at:1864"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1864"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1864: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1864"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1864"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1864: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1864"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1864"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1864: bison -fno-caret -Werror -Wno-error=other input.y"
at_fn_check_prepare_trace "input.at:1864"
( $at_check_trace; bison -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"; $as_echo "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:1864"
$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
$as_echo "$at_srcdir/input.at:1868: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wno-error=other -Werror input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1868"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1868"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1868: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y" "input.at:1868"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1868"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1868: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1868"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1868"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1868: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1868"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1868"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1868: bison -fno-caret -Wno-error=other -Werror input.y"
at_fn_check_prepare_trace "input.at:1868"
( $at_check_trace; bison -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"; $as_echo "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:1868"
$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
$as_echo "$at_srcdir/input.at:1872: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Werror=other -Wno-other input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1872"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1872"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1872: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y" "input.at:1872"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1872"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1872: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1872"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1872"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1872: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1872"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1872"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1872: bison -fno-caret -Werror=other -Wno-other input.y"
at_fn_check_prepare_trace "input.at:1872"
( $at_check_trace; bison -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:1872"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:1882' \
  "%name-prefix and api.prefix are incompatible" "   " 1
at_xfail=no
(
  $as_echo "43. $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
$as_echo "$at_srcdir/input.at:1897: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret  input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret  input.y" "input.at:1897"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret  input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-18: 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:1897"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'

%%
exp: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1898: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dapi.prefix={foo} -p bar input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dapi.prefix={foo} -p bar input.y" "input.at:1898"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dapi.prefix={foo} -p bar input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "<command line>:2: 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:1898"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%name-prefix "bar"
%%
exp: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1899: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dapi.prefix={foo} input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dapi.prefix={foo} input.y" "input.at:1899"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dapi.prefix={foo} input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "<command line>:2: 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:1899"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%define api.prefix {foo}
%%
exp: %empty;
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:1900: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -p bar input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -p bar input.y" "input.at:1900"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -p bar input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-18: 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:1900"
$at_failed && at_fn_log_failure
$at_traceon; }






  set +x
  $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:1911' \
  "Redefined %union name" "                          " 1
at_xfail=no
(
  $as_echo "44. $at_setup_line: testing $at_desc ..."
  $at_traceon


# AT_TEST(DIRECTIVES, ERROR)
# --------------------------


cat >input.y <<'_ATEOF'
%union foo {};
%union {};
%union foo {};
%define api.value.union.name foo
%%
exp: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1926: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1926"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.8-10: error: %define variable 'api.value.union.name' redefined
input.y:1.8-10:     previous definition
input.y:4.9-28: error: %define variable 'api.value.union.name' redefined
input.y:3.8-10:     previous definition
" | \
  $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:1926"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%define api.value.union.name {foo}
%%
exp: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1936: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1936"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-28: error: %define variable 'api.value.union.name' requires keyword values
input.y:1.9-28: 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:1936"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >input.y <<'_ATEOF'
%define api.value.union.name "foo"
%%
exp: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:1941: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:1941"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-28: error: %define variable 'api.value.union.name' requires keyword values
input.y:1.9-28: 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:1941"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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:1956' \
  "Stray \$ or @" "                                   " 1
at_xfail=no
(
  $as_echo "45. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%type <TYPE> exp
%token <TYPE> TOK TOK2
%destructor     { $%; @%; } <*> exp TOK;
%initial-action { $%; @%; };
%printer        { $%; @%; } <*> exp TOK;
%{ $ @ %} // Should not warn.
%%
exp: TOK        { $%; @%; $$ = $1; };
%%
$ @ // 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
$as_echo "$at_srcdir/input.at:1974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall input.y" "input.at:1974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:1974: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1974"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:1974: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1974"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:1974: bison -fno-caret -Wall input.y"
at_fn_check_prepare_trace "input.at:1974"
( $at_check_trace; bison -fno-caret -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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]
" | \
  $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:1974"
$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
$as_echo "$at_srcdir/input.at:1974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Werror" "input.at:1974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:1974: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1974"
( $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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:1974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=error" "input.at:1974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:1974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Wnone -Werror" "input.at:1974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1974"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:1974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=none -Werror" "input.at:1974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1974"
$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_45
#AT_START_46
at_fn_group_banner 46 'input.at:1994' \
  "Code injection" "                                 " 1
at_xfail=no
(
  $as_echo "46. $at_setup_line: testing $at_desc ..."
  $at_traceon




# AT_TEST([MACRO])
# ----------------
# Try to have MACRO be run by bison.


cat >input.y <<'_ATEOF'
%type <m4_errprintn(DEAD %type)> exp
%token <m4_errprintn(DEAD %token)> a
%token b
%initial-action
{
  $$;
  $<m4_errprintn(DEAD %initial-action)>$
};
%printer
{
  $$
  $<m4_errprintn(DEAD %printer)>$
} <> <*>;
%lex-param
{
  m4_errprintn(DEAD %lex-param)
};
%parse-param
{
  m4_errprintn(DEAD %parse-param)
};
%%
exp:
  a a[name] b
  {
    $$;
    $1;
    $<m4_errprintn(DEAD action 1)>$
    $<m4_errprintn(DEAD action 2)>1
    $<m4_errprintn(DEAD action 3)>name
    $<m4_errprintn(DEAD action 4)>0
    ;
  };
_ATEOF


# FIXME: Provide a means to iterate over all the skeletons.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d               input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d               input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d               input.y" "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2046: bison -fno-caret -d               input.y"
at_fn_check_prepare_trace "input.at:2046"
( $at_check_trace; bison -fno-caret -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:2046"
$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
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -S glr.c      input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -S glr.c      input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.c      input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.c      input.y" "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.c      input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2046: bison -fno-caret -d -S glr.c      input.y"
at_fn_check_prepare_trace "input.at:2046"
( $at_check_trace; bison -fno-caret -d -S glr.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:2046"
$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
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -S lalr1.cc   input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -S lalr1.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/input.at:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc   input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc   input.y" "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S lalr1.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/input.at:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2046: bison -fno-caret -d -S lalr1.cc   input.y"
at_fn_check_prepare_trace "input.at:2046"
( $at_check_trace; bison -fno-caret -d -S lalr1.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/input.at:2046"
$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
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -S glr.cc     input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -S glr.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/input.at:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.cc     input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.cc     input.y" "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.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/input.at:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2046: bison -fno-caret -d -S glr.cc     input.y"
at_fn_check_prepare_trace "input.at:2046"
( $at_check_trace; bison -fno-caret -d -S glr.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/input.at:2046"
$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
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot    -S lalr1.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot    -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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2046: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml    -S lalr1.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml    -S lalr1.java input.y" "input.at:2046"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml    -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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2046: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2046"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2046: bison -fno-caret    -S lalr1.java input.y"
at_fn_check_prepare_trace "input.at:2046"
( $at_check_trace; bison -fno-caret    -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:2046"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%type <]m4_errprintn(DEAD %type)> exp
%token <]m4_errprintn(DEAD %token)> a
%token b
%initial-action
{
  $$;
  $<]m4_errprintn(DEAD %initial-action)>$
};
%printer
{
  $$
  $<]m4_errprintn(DEAD %printer)>$
} <> <*>;
%lex-param
{
  ]m4_errprintn(DEAD %lex-param)
};
%parse-param
{
  ]m4_errprintn(DEAD %parse-param)
};
%%
exp:
  a a[name] b
  {
    $$;
    $1;
    $<]m4_errprintn(DEAD action 1)>$
    $<]m4_errprintn(DEAD action 2)>1
    $<]m4_errprintn(DEAD action 3)>name
    $<]m4_errprintn(DEAD action 4)>0
    ;
  };
_ATEOF


# FIXME: Provide a means to iterate over all the skeletons.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d               input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d               input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d               input.y" "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2047: bison -fno-caret -d               input.y"
at_fn_check_prepare_trace "input.at:2047"
( $at_check_trace; bison -fno-caret -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:2047"
$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
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -S glr.c      input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -S glr.c      input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.c      input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.c      input.y" "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.c      input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2047: bison -fno-caret -d -S glr.c      input.y"
at_fn_check_prepare_trace "input.at:2047"
( $at_check_trace; bison -fno-caret -d -S glr.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:2047"
$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
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -S lalr1.cc   input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -S lalr1.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/input.at:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc   input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc   input.y" "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S lalr1.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/input.at:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2047: bison -fno-caret -d -S lalr1.cc   input.y"
at_fn_check_prepare_trace "input.at:2047"
( $at_check_trace; bison -fno-caret -d -S lalr1.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/input.at:2047"
$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
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -S glr.cc     input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -S glr.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/input.at:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.cc     input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.cc     input.y" "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -S glr.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/input.at:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2047: bison -fno-caret -d -S glr.cc     input.y"
at_fn_check_prepare_trace "input.at:2047"
( $at_check_trace; bison -fno-caret -d -S glr.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/input.at:2047"
$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
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot    -S lalr1.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot    -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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2047: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml    -S lalr1.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml    -S lalr1.java input.y" "input.at:2047"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml    -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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2047: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2047"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2047: bison -fno-caret    -S lalr1.java input.y"
at_fn_check_prepare_trace "input.at:2047"
( $at_check_trace; bison -fno-caret    -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:2047"
$at_failed && at_fn_log_failure
$at_traceon; }






  set +x
  $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:2057' \
  "Deprecated directives" "                          " 1
at_xfail=no
(
  $as_echo "47. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%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 = "foo"
%pure_parser
%token_table
%glr-parser
%% 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
$as_echo "$at_srcdir/input.at:2084: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2084"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2084: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2084"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2084: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2084"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2084: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2084"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2084: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:2084"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:10.1-13: warning: deprecated directive: '%default_prec', use '%default-prec' [-Wdeprecated]
input.y:11.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
input.y:12.1-10: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-prefix' [-Wdeprecated]
input.y:14.1-15.2: warning: deprecated directive: '%file-prefix\\n =', use '%file-prefix' [-Wdeprecated]
input.y:17.1-19: warning: deprecated directive: '%fixed-output_files', use '%fixed-output-files' [-Wdeprecated]
input.y:18.1-19: warning: deprecated directive: '%fixed_output-files', use '%fixed-output-files' [-Wdeprecated]
input.y:20.1-13: warning: deprecated directive: '%name-prefix=', use '%name-prefix' [-Wdeprecated]
input.y:21.1-16: warning: deprecated directive: '%no-default_prec', use '%no-default-prec' [-Wdeprecated]
input.y:22.1-16: warning: deprecated directive: '%no_default-prec', use '%no-default-prec' [-Wdeprecated]
input.y:23.1-9: warning: deprecated directive: '%no_lines', use '%no-lines' [-Wdeprecated]
input.y:24.1-9: warning: deprecated directive: '%output =', use '%output' [-Wdeprecated]
input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%pure-parser' [-Wdeprecated]
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-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:2084"
$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
$as_echo "$at_srcdir/input.at:2084: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:2084"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:10.1-13: warning: deprecated directive: '%default_prec', use '%default-prec' [-Wdeprecated]
input.y:11.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
input.y:12.1-10: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-prefix' [-Wdeprecated]
input.y:14.1-15.2: warning: deprecated directive: '%file-prefix\n =', use '%file-prefix' [-Wdeprecated]
input.y:17.1-19: warning: deprecated directive: '%fixed-output_files', use '%fixed-output-files' [-Wdeprecated]
input.y:18.1-19: warning: deprecated directive: '%fixed_output-files', use '%fixed-output-files' [-Wdeprecated]
input.y:20.1-13: warning: deprecated directive: '%name-prefix=', use '%name-prefix' [-Wdeprecated]
input.y:21.1-16: warning: deprecated directive: '%no-default_prec', use '%no-default-prec' [-Wdeprecated]
input.y:22.1-16: warning: deprecated directive: '%no_default-prec', use '%no-default-prec' [-Wdeprecated]
input.y:23.1-9: warning: deprecated directive: '%no_lines', use '%no-lines' [-Wdeprecated]
input.y:24.1-9: warning: deprecated directive: '%output =', use '%output' [-Wdeprecated]
input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%pure-parser' [-Wdeprecated]
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:2084: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2084"
( $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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:2084: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:2084"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:2084: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:2084"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2084"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2084: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:2084"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2084"
$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_47
#AT_START_48
at_fn_group_banner 48 'input.at:2110' \
  "Unput's effect on locations" "                    " 1
at_xfail=no
(
  $as_echo "48. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%expect_rr 42 %expect_rr 42
              %expect_rr 42
%error_verbose %error_verbose
               %error_verbose
%% exp: '0'
_ATEOF




{ set +x
$as_echo "$at_srcdir/input.at:2124: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "input.at:2124"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
input.y:13.11-21: error: %define variable 'parse.error' redefined
input.y:13-6:         previous definition
input.y:14.16-29: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
input.y:14.11-21: error: %define variable 'parse.error' redefined
input.y:13.11-21:     previous definition
" | \
  $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:2124"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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:2143' \
  "Non-deprecated directives" "                      " 1
at_xfail=no
(
  $as_echo "49. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%default-prec
%error-verbose
%expect-rr 42
%file-prefix "foo"
%file-prefix
"bar"
%fixed-output-files
%name-prefix "foo"
%no-default-prec
%no-lines
%output "foo"
%pure-parser
%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
$as_echo "$at_srcdir/input.at:2165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:2165: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2165"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/input.at:2165: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2165"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/input.at:2165: bison -fno-caret input.y"
at_fn_check_prepare_trace "input.at:2165"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.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/input.at:2165"
$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
$as_echo "$at_srcdir/input.at:2165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "input.at:2165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: %expect-rr applies only to GLR parsers [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/input.at:2165: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2165"
( $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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/input.at:2165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "input.at:2165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/input.at:2165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "input.at:2165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2165"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:2165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "input.at:2165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:2165"
$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 'named-refs.at:21' \
  "Tutorial calculator" "                            " 2
at_xfail=no
(
  $as_echo "50. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
#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>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int get_char (void)
{
  int res = getc (input);
  return res;
}

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
$as_echo "$at_srcdir/named-refs.at:184: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:184"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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
$as_echo "$at_srcdir/named-refs.at:184: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:184"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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
$as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/named-refs.at:184: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "named-refs.at:184"
( $at_check_trace; bison -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; }


 { set +x
$as_echo "$at_srcdir/named-refs.at:184: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "named-refs.at:184"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$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
$as_echo "$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
$as_echo "$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_50
#AT_START_51
at_fn_group_banner 51 'named-refs.at:196' \
  "Undefined and ambiguous references" "             " 2
at_xfail=no
(
  $as_echo "51. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
static int power (int base, int exponent);
#include <stdio.h>

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
$as_echo "$at_srcdir/named-refs.at:254: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o test.c test.y" "named-refs.at:254"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "test.y:52.51-60: error: invalid reference: '\$<ival>lo9'
 | exp[x] '+' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>lo9 + \$r; }
                                                   ^^^^^^^^^^
test.y:52.3-68:      symbol not found in production: lo9
 | exp[x] '+' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>lo9 + \$r; }
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:53.51-60: warning: misleading reference: '\$<ival>exp' [-Wother]
 | exp[x] '-' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>exp - \$r; }
                                                   ^^^^^^^^^^
test.y:44.1-3:       refers to: \$exp at \$\$
 exp:
 ^^^
test.y:53.7:         possibly meant: \$x, hiding \$exp at \$1
 | exp[x] '-' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>exp - \$r; }
       ^
test.y:53.41:        possibly meant: \$r, hiding \$exp at \$4
 | exp[x] '-' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>exp - \$r; }
                                         ^
test.y:54.51-52: error: \$l of 'exp' has no declared type
 | exp[x] '*' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$l * \$r; }
                                                   ^^
test.y:57.40-43: error: invalid reference: '\$r12'
 | exp[l] '^' exp[r]  { \$\$ = power (\$l, \$r12); }
                                        ^^^^
test.y:57.3-47:      symbol not found in production: r12
 | exp[l] '^' exp[r]  { \$\$ = power (\$l, \$r12); }
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:58.29-33: error: invalid reference: '\$expo'
 | '(' exp ')'        { \$\$ = \$expo;           }
                             ^^^^^
test.y:58.3-46:      symbol not found in production: expo
 | '(' 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_51
#AT_START_52
at_fn_group_banner 52 'named-refs.at:297' \
  "Misleading references" "                          " 2
at_xfail=no
(
  $as_echo "52. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
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
$as_echo "$at_srcdir/named-refs.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/named-refs.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:305: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:305"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:305: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:305"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/named-refs.at:305: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "named-refs.at:305"
( $at_check_trace; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "test.y:11.22-29: warning: misleading reference: '\$foo.bar' [-Wother]
test.y:11.8-10:      refers to: \$foo at \$1
test.y:11.12-18:     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:305"
$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
$as_echo "$at_srcdir/named-refs.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y -Werror" "named-refs.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:      refers to: $foo at $1
test.y:11.12-18:     possibly meant: $[foo.bar] at $2
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/named-refs.at:305: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "named-refs.at:305"
( $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:305"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/named-refs.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y --warnings=error" "named-refs.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/named-refs.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y -Wnone -Werror" "named-refs.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/named-refs.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y --warnings=none -Werror" "named-refs.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:305"
$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_52
#AT_START_53
at_fn_group_banner 53 'named-refs.at:314' \
  "Many kinds of errors" "                           " 2
at_xfail=no
(
  $as_echo "53. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%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
$as_echo "$at_srcdir/named-refs.at:381: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:381"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1'
test.y:23.11-24.62:  symbol not found in production: cond1
test.y:26.43-53: error: invalid reference: '\$stmt.field'
test.y:25.11-26.60:  symbol not found in production: stmt
test.y:25.35-38:     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:  symbol not found in production: stmt
test.y:27.30-38:     possibly meant: \$[stmt.list] at \$4
test.y:30.43-46: error: ambiguous reference: '\$xyz'
test.y:29.35-37:     refers to: \$xyz at \$4
test.y:29.50-52:     refers to: \$xyz at \$6
test.y:32.43-52: error: invalid reference: '\$stmt.list'
test.y:31.11-32.63:  symbol not found in production: stmt
test.y:31.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
test.y:31.61-64:     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:  symbol not found in production: stmt
test.y:33.40-43:     possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
test.y:33.61-64:     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:  symbol not found in production: stmt.list
test.y:35.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
test.y:35.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
test.y:38.43-49: error: invalid reference: '\$then.1'
test.y:37.11-38.60:  symbol not found in production: then
test.y:37.40-45:     possibly meant: \$[then.1] at \$4
test.y:40.43-55: error: invalid reference: '\$then.1.field'
test.y:39.11-40.66:  symbol not found in production: then
test.y:39.40-45:     possibly meant: \$[then.1].field at \$4
test.y:42.44-50: error: invalid reference: '\$stmt.x'
test.y:41.12-42.57:  symbol not found in production: stmt
test.y:41.36-41:     possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
test.y:41.36-41:     possibly meant: \$[stmt.x] at \$4
test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
test.y:43.12-44.59:  symbol not found in production: if
test.y:43.1-9:       possibly meant: \$[if-stmt-a] at \$\$
test.y:46.46-54: error: invalid reference: '\$then-a.f'
test.y:45.12-46.65:  symbol not found in production: then
test.y:45.41-46:     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:381"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/named-refs.at:423: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o test.c test.y" "named-refs.at:423"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1'
           { \$if_stmt1 = new IfStmt(\$cond1, \$then.f1, \$else); };
                                    ^^^^^^
test.y:23.11-24.62:  symbol not found in production: cond1
 if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:26.43-53: error: invalid reference: '\$stmt.field'
           { \$if_stmt2 = new IfStmt(\$cond, \$stmt.field, 0); };
                                           ^^^^^^^^^^^
test.y:25.11-26.60:  symbol not found in production: stmt
 if_stmt2: IF expr[cond] THEN stmt[then] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:25.35-38:     possibly meant: \$then.field, hiding \$stmt.field at \$4
 if_stmt2: IF expr[cond] THEN stmt[then] FI
                                   ^^^^
test.y:28.43-52: error: invalid reference: '\$stmt.list'
           { \$if_stmt3 = new IfStmt(\$cond, \$stmt.list, 0); };
                                           ^^^^^^^^^^
test.y:27.11-28.59:  symbol not found in production: stmt
 if_stmt3: IF expr[cond] THEN stmt.list FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:27.30-38:     possibly meant: \$[stmt.list] at \$4
 if_stmt3: IF expr[cond] THEN stmt.list FI
                              ^^^^^^^^^
test.y:30.43-46: error: ambiguous reference: '\$xyz'
           { \$if_stmt4 = new IfStmt(\$cond, \$xyz, \$cond); };
                                           ^^^^
test.y:29.35-37:     refers to: \$xyz at \$4
 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
                                   ^^^
test.y:29.50-52:     refers to: \$xyz at \$6
 if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
                                                  ^^^
test.y:32.43-52: error: invalid reference: '\$stmt.list'
           { \$if_stmt5 = new IfStmt(\$cond, \$stmt.list, \$else); };
                                           ^^^^^^^^^^
test.y:31.11-32.63:  symbol not found in production: stmt
 if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:31.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
 if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
                                        ^^^^
test.y:31.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
 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'
           { \$if_stmt6 = new IfStmt(\$cond, \$stmt.list.field, \$else); };
                                           ^^^^^^^^^^^^^^^^
test.y:33.11-34.69:  symbol not found in production: stmt
 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:33.40-43:     possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
                                        ^^^^
test.y:33.61-64:     possibly meant: \$else.field, hiding \$[stmt.list].field at \$6
 if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
                                                             ^^^^
test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
           { \$if_stmt7 = new IfStmt(\$cond, \$[stmt.list].field, \$else); };
                                           ^^^^^^^^^^^^
test.y:35.11-36.71:  symbol not found in production: stmt.list
 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:35.40-43:     possibly meant: \$then, hiding \$[stmt.list] at \$4
 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
                                        ^^^^
test.y:35.61-64:     possibly meant: \$else, hiding \$[stmt.list] at \$6
 if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
                                                             ^^^^
test.y:38.43-49: error: invalid reference: '\$then.1'
           { \$if_stmt8 = new IfStmt(\$cond, \$then.1, \$else); };
                                           ^^^^^^^
test.y:37.11-38.60:  symbol not found in production: then
 if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:37.40-45:     possibly meant: \$[then.1] at \$4
 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'
           { \$if_stmt9 = new IfStmt(\$cond, \$then.1.field, \$else); };
                                           ^^^^^^^^^^^^^
test.y:39.11-40.66:  symbol not found in production: then
 if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:39.40-45:     possibly meant: \$[then.1].field at \$4
 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'
           { \$if_stmt10 = new IfStmt(\$cond, \$stmt.x, 0); };
                                            ^^^^^^^
test.y:41.12-42.57:  symbol not found in production: stmt
 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:41.36-41:     possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
                                    ^^^^^^
test.y:41.36-41:     possibly meant: \$[stmt.x] at \$4
 if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
                                    ^^^^^^
test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
           { \$if-stmt-a = new IfStmt(\$cond, \$then, \$else); };
             ^^^^^^^^^^
test.y:43.12-44.59:  symbol not found in production: if
 if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:43.1-9:       possibly meant: \$[if-stmt-a] at \$\$
 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'
           { \$[if-stmt-b] = new IfStmt(\$cond, \$then-a.f, \$else); };
                                              ^^^^^^^^^
test.y:45.12-46.65:  symbol not found in production: then
 if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.y:45.41-46:     possibly meant: \$[then-a].f at \$4
 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:423"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'named-refs.at:547' \
  "Missing identifiers in brackets" "                " 2
at_xfail=no
(
  $as_echo "54. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
start: foo[] bar
  { s = $foo; }
_ATEOF



{ set +x
$as_echo "$at_srcdir/named-refs.at:554: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:554"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:554"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:561' \
  "Redundant words in brackets" "                    " 2
at_xfail=no
(
  $as_echo "55. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
start: foo[ a d ] bar
  { s = $foo; }
_ATEOF



{ set +x
$as_echo "$at_srcdir/named-refs.at:568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:568"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:568"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:575' \
  "Comments in brackets" "                           " 2
at_xfail=no
(
  $as_echo "56. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
start: foo[/* comment */] bar
  { s = $foo; }
_ATEOF



{ set +x
$as_echo "$at_srcdir/named-refs.at:582: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:582"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:582"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:589' \
  "Stray symbols in brackets" "                      " 2
at_xfail=no
(
  $as_echo "57. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
start: foo[ % /* aaa */ *&-.+\000\001\002\377 ] bar
  { s = $foo; }
_ATEOF


{ set +x
$as_echo "$at_srcdir/named-refs.at:596: \$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:596"
( $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:596"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/named-refs.at:597: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:597"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:597"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:606' \
  "Redundant words in LHS brackets" "                " 2
at_xfail=no
(
  $as_echo "58. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
start[a s]: foo;
_ATEOF



{ set +x
$as_echo "$at_srcdir/named-refs.at:612: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:612"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:612"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:621' \
  "Factored LHS" "                                   " 2
at_xfail=no
(
  $as_echo "59. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
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
$as_echo "$at_srcdir/named-refs.at:627: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:627"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:627"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/named-refs.at:627: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:627"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:627"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:627: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:627"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:627"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:627: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:627"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:627"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/named-refs.at:627: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "named-refs.at:627"
( $at_check_trace; bison -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:627"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:632' \
  "Unresolved references" "                          " 2
at_xfail=no
(
  $as_echo "60. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%%
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
$as_echo "$at_srcdir/named-refs.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y" "named-refs.at:659"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "test.y:12.22-31: error: invalid reference: '\$sym.field'
test.y:12.3-35:      symbol not found in production: sym
test.y:13.22-35: error: invalid reference: '\$<aa>sym.field'
test.y:13.3-39:      symbol not found in production: sym
test.y:14.22-33: error: invalid reference: '\$[sym.field]'
test.y:14.3-37:      symbol not found in production: sym.field
test.y:15.22-37: error: invalid reference: '\$<aa>[sym.field]'
test.y:15.3-41:      symbol not found in production: sym.field
test.y:16.22-25: error: invalid reference: '\$sym'
test.y:16.3-29:      symbol not found in production: sym
test.y:17.22-29: error: invalid reference: '\$<aa>sym'
test.y:17.3-33:      symbol not found in production: sym
test.y:18.22-27: error: invalid reference: '\$[sym]'
test.y:18.3-65:      symbol not found in production before \$3: sym
test.y:18.52-61: error: invalid reference: '\$<aa>[sym]'
test.y:18.3-65:      symbol not found in production: sym
test.y:22.22-31: error: invalid reference: '\$sym-field'
test.y:22.3-35:      symbol not found in production: sym
test.y:23.22-35: error: invalid reference: '\$<aa>sym-field'
test.y:23.3-39:      symbol not found in production: sym
test.y:24.22-33: error: invalid reference: '\$[sym-field]'
test.y:24.3-37:      symbol not found in production: sym-field
test.y:25.22-37: error: invalid reference: '\$<aa>[sym-field]'
test.y:25.3-41:      symbol not found in production: sym-field
test.y:26.22-25: error: invalid reference: '\$sym'
test.y:26.3-29:      symbol not found in production: sym
test.y:27.22-29: error: invalid reference: '\$<aa>sym'
test.y:27.3-33:      symbol not found in production: sym
test.y:28.22-27: error: invalid reference: '\$[sym]'
test.y:28.3-65:      symbol not found in production before \$3: sym
test.y:28.52-61: error: invalid reference: '\$<aa>[sym]'
test.y:28.3-65:      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:659"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'named-refs.at:697' \
  "\$ or @ followed by . or -" "                      " 2
at_xfail=no
(
  $as_echo "61. $at_setup_line: testing $at_desc ..."
  $at_traceon

cat >test.y <<'_ATEOF'

%%
start:
  .field { $.field; }
| 'a'    { @.field; }
;
.field: ;
_ATEOF


{ set +x
$as_echo "$at_srcdir/named-refs.at:707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y" "named-refs.at:707"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "test.y:4.12-18: error: invalid reference: '\$.field'
test.y:4.13:        syntax error after '\$', expecting integer, letter, '_', '[', or '\$'
test.y:4.3-8:       possibly meant: \$[.field] at \$1
test.y:5.12-18: error: invalid reference: '@.field'
test.y:5.13:        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:707"
$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
$as_echo "$at_srcdir/named-refs.at:722: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:722"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:722"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/named-refs.at:722: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml test.y" "named-refs.at:722"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:722"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:722: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:722"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:722"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/named-refs.at:722: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:722"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:722"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/named-refs.at:722: bison -fno-caret test.y"
at_fn_check_prepare_trace "named-refs.at:722"
( $at_check_trace; bison -fno-caret test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:722"
$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
$as_echo "$at_srcdir/named-refs.at:722: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y -Werror" "named-refs.at:722"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:722"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/named-refs.at:722: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "named-refs.at:722"
( $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:722"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/named-refs.at:722: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y --warnings=error" "named-refs.at:722"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:722"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/named-refs.at:722: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y -Wnone -Werror" "named-refs.at:722"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret test.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:722"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/named-refs.at:722: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret test.y --warnings=none -Werror" "named-refs.at:722"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret test.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:722"
$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_61
#AT_START_62
at_fn_group_banner 62 'output.at:56' \
  "Output files:  -dv" "                             " 3
at_xfail=no
(
  $as_echo "62. $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: %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
$as_echo "$at_srcdir/output.at:56: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:56"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:56"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:56: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv foo.y" "output.at:56"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:56"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:56: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:56"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:56"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:56: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:56"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:56"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:56: bison -fno-caret -dv foo.y"
at_fn_check_prepare_trace "output.at:56"
( $at_check_trace; bison -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:56"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:56: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:56"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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: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_62
#AT_START_63
at_fn_group_banner 63 'output.at:62' \
  "Output files:  -dv >&-" "                         " 3
at_xfail=no
(
  $as_echo "63. $at_setup_line: testing $at_desc ..."
  $at_traceon

{ set +x
$as_echo "$at_srcdir/output.at:62: case \"\$PREBISON\" in *valgrind*) exit 77;; esac"
at_fn_check_prepare_dynamic "case \"$PREBISON\" in *valgrind*) exit 77;; esac" "output.at:62"
( $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:62"
$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: %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
$as_echo "$at_srcdir/output.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv >&- foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:62"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y" "output.at:62"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:62: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:62"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:62: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:62"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:62: bison -fno-caret -dv >&- foo.y"
at_fn_check_prepare_trace "output.at:62"
( $at_check_trace; bison -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:62"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:62: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:62"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:62"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:67' \
  "Output files:  -dv -o foo.c" "                    " 3
at_xfail=no
(
  $as_echo "64. $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: %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
$as_echo "$at_srcdir/output.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -o foo.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:67"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y" "output.at:67"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:67: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:67"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:67: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:67"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:67: bison -fno-caret -dv -o foo.c foo.y"
at_fn_check_prepare_trace "output.at:67"
( $at_check_trace; bison -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:67"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:67: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:67"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.c foo.h foo.output
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:67"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:69' \
  "Output files:  -dv -o foo.tab.c" "                " 3
at_xfail=no
(
  $as_echo "65. $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: %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
$as_echo "$at_srcdir/output.at:69: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:69"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:69"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:69: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y" "output.at:69"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:69"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:69: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:69"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:69"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:69: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:69"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:69"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:69: bison -fno-caret -dv -o foo.tab.c foo.y"
at_fn_check_prepare_trace "output.at:69"
( $at_check_trace; bison -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:69"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:69: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:69"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:69"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:72' \
  "Output files:  -dv -g --xml -y" "                 " 3
at_xfail=no
(
  $as_echo "66. $at_setup_line: testing $at_desc ..."
  $at_traceon


for file in foo.y y.dot 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: %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
$as_echo "$at_srcdir/output.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -g --xml -y foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:72"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" "output.at:72"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:72"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:72: bison -fno-caret -dv -g --xml -y foo.y"
at_fn_check_prepare_trace "output.at:72"
( $at_check_trace; bison -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:72"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:72: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:72"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "y.dot 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: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_66
#AT_START_67
at_fn_group_banner 67 'output.at:75' \
  "Output files:  -dv -g --xml -o y.tab.c" "         " 3
at_xfail=no
(
  $as_echo "67. $at_setup_line: testing $at_desc ..."
  $at_traceon


for file in foo.y y.dot 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: %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
$as_echo "$at_srcdir/output.at:75: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -g --xml -o y.tab.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:75"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:75"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:75: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y" "output.at:75"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:75"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:75: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:75"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:75"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:75: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:75"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:75"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:75: bison -fno-caret -dv -g --xml -o y.tab.c foo.y"
at_fn_check_prepare_trace "output.at:75"
( $at_check_trace; bison -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:75"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:75: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:75"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "y.dot 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:75"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:78' \
  "Output files:  -dv -b bar" "                      " 3
at_xfail=no
(
  $as_echo "68. $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: %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
$as_echo "$at_srcdir/output.at:78: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -b bar foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:78"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:78"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:78: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y" "output.at:78"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:78"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:78: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:78"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:78"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:78: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:78"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:78"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:78: bison -fno-caret -dv -b bar foo.y"
at_fn_check_prepare_trace "output.at:78"
( $at_check_trace; bison -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:78"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:78: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:78"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:78"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:80' \
  "Output files:  -dv -g -o foo.c" "                 " 3
at_xfail=no
(
  $as_echo "69. $at_setup_line: testing $at_desc ..."
  $at_traceon


for file in foo.y foo.c foo.dot foo.h foo.output; do
  case $file in
    */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
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
$as_echo "$at_srcdir/output.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -g -o foo.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:80"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y" "output.at:80"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:80: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:80"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:80: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:80"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:80: bison -fno-caret -dv -g -o foo.c foo.y"
at_fn_check_prepare_trace "output.at:80"
( $at_check_trace; bison -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:80"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:80: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:80"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.c foo.dot foo.h foo.output
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:80"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:84' \
  "Output files: %defines %verbose " "               " 3
at_xfail=no
(
  $as_echo "70. $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'
%defines %verbose
%%
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
$as_echo "$at_srcdir/output.at:84: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:84"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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
$as_echo "$at_srcdir/output.at:84: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y" "output.at:84"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:84"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:84: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:84: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:84"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:84: bison -fno-caret  foo.y"
at_fn_check_prepare_trace "output.at:84"
( $at_check_trace; bison -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:84"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$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\" }'"
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" }'
) >>"$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"; $as_echo "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: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_70
#AT_START_71
at_fn_group_banner 71 'output.at:86' \
  "Output files: %defines %verbose %yacc " "         " 3
at_xfail=no
(
  $as_echo "71. $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'
%defines %verbose %yacc
%%
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
$as_echo "$at_srcdir/output.at:86: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:86"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:86"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:86: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y" "output.at:86"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:86"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:86: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:86"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:86"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:86: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:86"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:86"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:86: bison -fno-caret  foo.y"
at_fn_check_prepare_trace "output.at:86"
( $at_check_trace; bison -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:86"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:86: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:86"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:86"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:89' \
  "Output files: %defines %verbose %yacc " "         " 3
at_xfail=no
(
  $as_echo "72. $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'
%defines %verbose %yacc
%%
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
$as_echo "$at_srcdir/output.at:89: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:89"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:89: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy" "output.at:89"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:89"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:89: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:89"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:89: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:89"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:89: bison -fno-caret  foo.yy"
at_fn_check_prepare_trace "output.at:89"
( $at_check_trace; bison -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:89"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:89: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:89"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:89"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:93' \
  "Output files: %file-prefix \"bar\" %defines %verbose " "" 3
at_xfail=no
(
  $as_echo "73. $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" %defines %verbose
%%
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
$as_echo "$at_srcdir/output.at:93: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:93"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:93"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:93: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y" "output.at:93"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:93"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:93"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:93"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:93"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:93: bison -fno-caret  foo.y"
at_fn_check_prepare_trace "output.at:93"
( $at_check_trace; bison -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:93"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:93: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:93"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:93"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:95' \
  "Output files: %output \"bar.c\" %defines %verbose %yacc " "" 3
at_xfail=no
(
  $as_echo "74. $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" %defines %verbose %yacc
%%
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
$as_echo "$at_srcdir/output.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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
$as_echo "$at_srcdir/output.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y" "output.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:95"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:95: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:95: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:95"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:95: bison -fno-caret  foo.y"
at_fn_check_prepare_trace "output.at:95"
( $at_check_trace; bison -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:95"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$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\" }'"
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" }'
) >>"$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"; $as_echo "bar.c bar.h bar.output
" | \
  $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_74
#AT_START_75
at_fn_group_banner 75 'output.at:97' \
  "Output files: %file-prefix \"baz\" %output \"bar.c\" %defines %verbose %yacc " "" 3
at_xfail=no
(
  $as_echo "75. $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" %defines %verbose %yacc
%%
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
$as_echo "$at_srcdir/output.at:97: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:97"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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
$as_echo "$at_srcdir/output.at:97: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.y" "output.at:97"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:97"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:97: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:97: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:97: bison -fno-caret  foo.y"
at_fn_check_prepare_trace "output.at:97"
( $at_check_trace; bison -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:97"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$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\" }'"
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" }'
) >>"$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"; $as_echo "bar.c bar.h bar.output
" | \
  $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_75
#AT_START_76
at_fn_group_banner 76 'output.at:104' \
  "Output files: %defines %verbose " "               " 3
at_xfail=no
(
  $as_echo "76. $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'
%defines %verbose
%%
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
$as_echo "$at_srcdir/output.at:104: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:104"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:104: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy" "output.at:104"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:104: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:104: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:104"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:104: bison -fno-caret  foo.yy"
at_fn_check_prepare_trace "output.at:104"
( $at_check_trace; bison -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:104"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:104: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
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.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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: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_76
#AT_START_77
at_fn_group_banner 77 'output.at:107' \
  "Output files: %defines %verbose  -o foo.c" "      " 3
at_xfail=no
(
  $as_echo "77. $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'
%defines %verbose
%%
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
$as_echo "$at_srcdir/output.at:107: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o foo.c foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:107"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:107"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:107: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy" "output.at:107"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:107"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:107: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:107: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:107"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:107: bison -fno-caret -o foo.c foo.yy"
at_fn_check_prepare_trace "output.at:107"
( $at_check_trace; bison -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:107"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:107: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
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.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.c foo.h foo.output
" | \
  $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_77
#AT_START_78
at_fn_group_banner 78 'output.at:110' \
  "Output files:  --defines=foo.hpp -o foo.c++" "    " 3
at_xfail=no
(
  $as_echo "78. $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: %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
$as_echo "$at_srcdir/output.at:110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:110"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines=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:110"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:110: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy" "output.at:110"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=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:110"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:110: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:110: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:110"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:110: bison -fno-caret --defines=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:110"
( $at_check_trace; bison -fno-caret --defines=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:110"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:110: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
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.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.c++ foo.hpp
" | \
  $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_78
#AT_START_79
at_fn_group_banner 79 'output.at:114' \
  "Output files: %defines \"foo.hpp\" -o foo.c++" "    " 3
at_xfail=no
(
  $as_echo "79. $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: %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
$as_echo "$at_srcdir/output.at:114: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:114"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:114"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:114: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:114"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:114"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:114: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:114"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:114"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:114: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:114"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:114"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:114: bison -fno-caret -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:114"
( $at_check_trace; bison -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:114"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:114: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:114"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.c++ foo.hpp
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:114"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:118' \
  "Output files:  -o foo.c++ --graph=foo.gph" "      " 3
at_xfail=no
(
  $as_echo "80. $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: %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
$as_echo "$at_srcdir/output.at:118: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o foo.c++  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:118"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:118"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:118: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o foo.c++  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o foo.c++  foo.yy" "output.at:118"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:118"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:118: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:118: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:118"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:118: bison -fno-caret -o foo.c++ --graph=foo.gph foo.yy"
at_fn_check_prepare_trace "output.at:118"
( $at_check_trace; bison -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:118"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:118: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
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.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.c++ foo.gph
" | \
  $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_80
#AT_START_81
at_fn_group_banner 81 'output.at:124' \
  "Output files: %type <foo> useless --defines --graph --xml --report=all -Wall -Werror" "" 3
at_xfail=no
(
  $as_echo "81. $at_setup_line: testing $at_desc ..."
  $at_traceon


for file in foo.y foo.dot foo.output foo.xml; do
  case $file in
    */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%type <foo> useless
%%
foo: %empty {};
_ATEOF



{ set +x
$as_echo "$at_srcdir/output.at:124: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y" "output.at:124"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --defines --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:124"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:124: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:124"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.dot foo.output foo.xml
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:124"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'output.at:131' \
  "Output files: useless=--defines --graph --xml --report=all -Wall -Werror" "" 3
at_xfail=no
(
  $as_echo "82. $at_setup_line: testing $at_desc ..."
  $at_traceon


for file in foo.y foo.dot foo.output foo.xml; do
  case $file in
    */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%define useless
%%
foo: %empty {};
_ATEOF



{ set +x
$as_echo "$at_srcdir/output.at:131: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y" "output.at:131"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --defines --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:131"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:131: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:131"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.y|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.dot foo.output foo.xml
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.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_82
#AT_START_83
at_fn_group_banner 83 'output.at:147' \
  "Output files: lalr1.cc %verbose " "               " 3
at_xfail=no
(
  $as_echo "83. $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: %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
$as_echo "$at_srcdir/output.at:147: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:147"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:147"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:147: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy" "output.at:147"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:147"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:147: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:147"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:147"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:147: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:147"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:147"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:147: bison -fno-caret  foo.yy"
at_fn_check_prepare_trace "output.at:147"
( $at_check_trace; bison -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:147"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:147: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:147"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.output foo.tab.cc
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:147"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:150' \
  "Output files: lalr1.cc %defines %verbose " "      " 3
at_xfail=no
(
  $as_echo "84. $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" %defines %verbose
%%
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
$as_echo "$at_srcdir/output.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:150"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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
$as_echo "$at_srcdir/output.at:150: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy" "output.at:150"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:150"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:150: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:150: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:150"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:150: bison -fno-caret  foo.yy"
at_fn_check_prepare_trace "output.at:150"
( $at_check_trace; bison -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:150"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$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\" }'"
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" }'
) >>"$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"; $as_echo "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: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_84
#AT_START_85
at_fn_group_banner 85 'output.at:153' \
  "Output files: lalr1.cc %verbose %locations " "    " 3
at_xfail=no
(
  $as_echo "85. $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: %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
$as_echo "$at_srcdir/output.at:153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:153"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:153"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:153: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy" "output.at:153"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:153"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:153: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:153"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:153"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:153: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:153"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:153"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:153: bison -fno-caret  foo.yy"
at_fn_check_prepare_trace "output.at:153"
( $at_check_trace; bison -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:153"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:153: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:153"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "foo.output foo.tab.cc
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:153"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:156' \
  "Output files: lalr1.cc %defines %verbose %locations " "" 3
at_xfail=no
(
  $as_echo "86. $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" %defines %verbose %locations
%%
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
$as_echo "$at_srcdir/output.at:156: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:156"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:156"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:156: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  foo.yy" "output.at:156"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:156"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:156: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:156"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:156"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:156: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:156"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:156"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:156: bison -fno-caret  foo.yy"
at_fn_check_prepare_trace "output.at:156"
( $at_check_trace; bison -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:156"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:156: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:156"
( $at_check_trace; find . -type f |
           $PERL -ne '
      s,\./,,; chomp;
      push @file, $_ unless m{^(foo.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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:156"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:159' \
  "Output files: lalr1.cc %defines %verbose " "      " 3
at_xfail=no
(
  $as_echo "87. $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" %defines %verbose
%%
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
$as_echo "$at_srcdir/output.at:159: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  subdir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:159"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:159"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:159: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  subdir/foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  subdir/foo.yy" "output.at:159"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:159"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:159: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:159"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:159"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:159: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:159"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:159"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:159: bison -fno-caret  subdir/foo.yy"
at_fn_check_prepare_trace "output.at:159"
( $at_check_trace; bison -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:159"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:159: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(subdir/foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:159"
( $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" }'
) >>"$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"; $as_echo "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:159"
$at_failed && at_fn_log_failure
$at_traceon; }

# Also make sure that the includes do not refer to the subdirectory.
{ set +x
$as_echo "$at_srcdir/output.at:159: grep 'include .subdir/' foo.tab.cc"
at_fn_check_prepare_trace "output.at:159"
( $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:159"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:159: grep 'include .subdir/' foo.tab.hh"
at_fn_check_prepare_trace "output.at:159"
( $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:159"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:163' \
  "Output files: lalr1.cc %defines %verbose %locations -o subdir/foo.cc" "" 3
at_xfail=no
(
  $as_echo "88. $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" %defines %verbose %locations
%%
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
$as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:163"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:163: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy" "output.at:163"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:163"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:163: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:163"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:163: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:163"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:163: bison -fno-caret -o subdir/foo.cc subdir/foo.yy"
at_fn_check_prepare_trace "output.at:163"
( $at_check_trace; bison -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:163"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:163: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(subdir/foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:163"
( $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" }'
) >>"$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"; $as_echo "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:163"
$at_failed && at_fn_log_failure
$at_traceon; }

# Also make sure that the includes do not refer to the subdirectory.
{ set +x
$as_echo "$at_srcdir/output.at:163: grep 'include .subdir/' subdir/foo.cc"
at_fn_check_prepare_trace "output.at:163"
( $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:163"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:163: grep 'include .subdir/' subdir/foo.hh"
at_fn_check_prepare_trace "output.at:163"
( $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:163"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:168' \
  "Output files: lalr1.cc %defines %verbose %file-prefix \"output_dir/foo\" " "" 3
at_xfail=no
(
  $as_echo "89. $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" %defines %verbose %file-prefix "output_dir/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
$as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  gram_dir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:168"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:168"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:168: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  gram_dir/foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  gram_dir/foo.yy" "output.at:168"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:168"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:168: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:168"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:168"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:168: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:168"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:168"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:168: bison -fno-caret  gram_dir/foo.yy"
at_fn_check_prepare_trace "output.at:168"
( $at_check_trace; bison -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:168"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:168: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(gram_dir/foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:168"
( $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" }'
) >>"$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"; $as_echo "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:168"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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:173' \
  "Output files: lalr1.cc %defines %locations %verbose %file-prefix \"output_dir/foo\" " "" 3
at_xfail=no
(
  $as_echo "90. $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" %defines %locations %verbose %file-prefix "output_dir/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
$as_echo "$at_srcdir/output.at:173: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  gram_dir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:173"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  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:173"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:173: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  gram_dir/foo.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  gram_dir/foo.yy" "output.at:173"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:173"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:173: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:173: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:173"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:173: bison -fno-caret  gram_dir/foo.yy"
at_fn_check_prepare_trace "output.at:173"
( $at_check_trace; bison -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:173"
$at_failed && at_fn_log_failure
$at_traceon; }


# Ignore the files non-generated files
{ set +x
$as_echo "$at_srcdir/output.at:173: find . -type f |
           \$PERL -ne '
      s,\\./,,; chomp;
      push @file, \$_ unless m{^(gram_dir/foo.yy|testsuite.log)\$};
      END { print join (\" \", sort @file), \"\\n\" }'"
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{^(gram_dir/foo.yy|testsuite.log)$};
      END { print join (" ", sort @file), "\n" }'
) >>"$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"; $as_echo "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: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_90
#AT_START_91
at_fn_group_banner 91 'output.at:203' \
  "Conflicting output files:  --graph=\"foo.tab.c\"" " " 3
at_xfail=no
(
  $as_echo "91. $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
$as_echo "$at_srcdir/output.at:203: bison -fno-caret --graph=\"foo.tab.c\" foo.y"
at_fn_check_prepare_trace "output.at:203"
( $at_check_trace; bison -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"; $as_echo "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:203"
$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
$as_echo "$at_srcdir/output.at:203: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y -Werror" "output.at:203"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:203"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/output.at:203: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:203"
( $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:203"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/output.at:203: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=error" "output.at:203"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:203"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/output.at:203: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y -Wnone -Werror" "output.at:203"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --graph="foo.tab.c" foo.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  { set +x
$as_echo "$at_srcdir/output.at:203: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=none -Werror" "output.at:203"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --graph="foo.tab.c" foo.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:203: cat foo.y"
at_fn_check_prepare_trace "output.at:203"
( $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: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_91
#AT_START_92
at_fn_group_banner 92 'output.at:208' \
  "Conflicting output files: %defines \"foo.output\" -v" "" 3
at_xfail=no
(
  $as_echo "92. $at_setup_line: testing $at_desc ..."
  $at_traceon

case "foo.y" in
  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%defines "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
$as_echo "$at_srcdir/output.at:208: bison -fno-caret -v foo.y"
at_fn_check_prepare_trace "output.at:208"
( $at_check_trace; bison -fno-caret -v foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:208"
$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
$as_echo "$at_srcdir/output.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y -Werror" "output.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:208"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/output.at:208: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:208"
( $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:208"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/output.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y --warnings=error" "output.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:208"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/output.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y -Wnone -Werror" "output.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v foo.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v foo.y --warnings=none -Werror" "output.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v foo.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:208"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:208: cat foo.y"
at_fn_check_prepare_trace "output.at:208"
( $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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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:213' \
  "Conflicting output files: lalr1.cc %defines %locations --graph=\"location.hh\"" "" 3
at_xfail=no
(
  $as_echo "93. $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" %defines %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
$as_echo "$at_srcdir/output.at:213: bison -fno-caret --graph=\"location.hh\" foo.y"
at_fn_check_prepare_trace "output.at:213"
( $at_check_trace; bison -fno-caret --graph="location.hh" foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:213"
$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
$as_echo "$at_srcdir/output.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y -Werror" "output.at:213"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:213"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/output.at:213: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:213"
( $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:213"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/output.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y --warnings=error" "output.at:213"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:213"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/output.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y -Wnone -Werror" "output.at:213"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --graph="location.hh" foo.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:213"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:213: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --graph=\"location.hh\" foo.y --warnings=none -Werror" "output.at:213"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --graph="location.hh" foo.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:213"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:213: cat foo.y"
at_fn_check_prepare_trace "output.at:213"
( $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: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_93
#AT_START_94
at_fn_group_banner 94 'output.at:218' \
  "Conflicting output files:  -o foo.y" "            " 3
at_xfail=no
(
  $as_echo "94. $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
$as_echo "$at_srcdir/output.at:218: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o foo.y foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o foo.y foo.y" "output.at:218"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o foo.y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:218"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:218: cat foo.y"
at_fn_check_prepare_trace "output.at:218"
( $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:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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:264' \
  "Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'" "" 3
at_xfail=no
(
  $as_echo "95. $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
$as_echo "$at_srcdir/output.at:264: touch \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.tmp\" || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $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:264"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:264: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:264: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:264: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:264"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:264: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:264: bison -fno-caret -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; bison -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.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:264"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:264: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:264: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:264"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:264: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" "
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $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:264"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:264: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:264: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:264: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:264"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:264: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:264: bison -fno-caret -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; bison -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.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:264"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:264: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $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:264"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:264: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:264"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:264: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" "
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:264"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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: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_95
#AT_START_96
at_fn_group_banner 96 'output.at:271' \
  "Output file name: (" "                            " 3
at_xfail=no
(
  $as_echo "96. $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
$as_echo "$at_srcdir/output.at:271: touch \"(.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:271"
( $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:271"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:271: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:271"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "(.c" --defines="(.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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:271: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y" "output.at:271"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "(.c" --defines="(.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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:271: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:271"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:271: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:271"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:271: bison -fno-caret -o \"(.c\" --defines=\"(.h\" glr.y"
at_fn_check_prepare_trace "output.at:271"
( $at_check_trace; bison -fno-caret -o "(.c" --defines="(.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:271"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:271: ls \"(.c\" \"(.h\""
at_fn_check_prepare_trace "output.at:271"
( $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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:271: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:271"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:271: \$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:271"
( $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:271"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:271: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"(.cc\" --defines=\"(.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:271"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "(.cc" --defines="(.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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:271: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"(.cc\" --defines=\"(.hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"(.cc\" --defines=\"(.hh\" cxx.y" "output.at:271"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "(.cc" --defines="(.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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:271: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:271"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:271: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:271"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:271: bison -fno-caret -o \"(.cc\" --defines=\"(.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:271"
( $at_check_trace; bison -fno-caret -o "(.cc" --defines="(.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:271"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:271: ls \"(.cc\" \"(.hh\""
at_fn_check_prepare_trace "output.at:271"
( $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:271"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:271: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:271"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:271"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:271: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"(.cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"(.cc\" " "output.at:271"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:271"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:272' \
  "Output file name: )" "                            " 3
at_xfail=no
(
  $as_echo "97. $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
$as_echo "$at_srcdir/output.at:272: touch \").tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:272"
( $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:272"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:272: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:272"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o ").c" --defines=").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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:272: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y" "output.at:272"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o ").c" --defines=").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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:272: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:272"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:272: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:272"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:272: bison -fno-caret -o \").c\" --defines=\").h\" glr.y"
at_fn_check_prepare_trace "output.at:272"
( $at_check_trace; bison -fno-caret -o ").c" --defines=").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:272"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:272: ls \").c\" \").h\""
at_fn_check_prepare_trace "output.at:272"
( $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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:272: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:272"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:272: \$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:272"
( $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:272"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:272: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \").cc\" --defines=\").hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:272"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o ").cc" --defines=").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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:272: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \").cc\" --defines=\").hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \").cc\" --defines=\").hh\" cxx.y" "output.at:272"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o ").cc" --defines=").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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:272: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:272"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:272: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:272"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:272: bison -fno-caret -o \").cc\" --defines=\").hh\" cxx.y"
at_fn_check_prepare_trace "output.at:272"
( $at_check_trace; bison -fno-caret -o ").cc" --defines=").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:272"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:272: ls \").cc\" \").hh\""
at_fn_check_prepare_trace "output.at:272"
( $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:272"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:272: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:272"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:272"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:272: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \").cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \").cc\" " "output.at:272"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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: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_97
#AT_START_98
at_fn_group_banner 98 'output.at:273' \
  "Output file name: #" "                            " 3
at_xfail=no
(
  $as_echo "98. $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
$as_echo "$at_srcdir/output.at:273: touch \"#.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:273"
( $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:273"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:273: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:273"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "#.c" --defines="#.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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:273: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y" "output.at:273"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "#.c" --defines="#.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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:273: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:273"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:273: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:273"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:273: bison -fno-caret -o \"#.c\" --defines=\"#.h\" glr.y"
at_fn_check_prepare_trace "output.at:273"
( $at_check_trace; bison -fno-caret -o "#.c" --defines="#.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:273"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:273: ls \"#.c\" \"#.h\""
at_fn_check_prepare_trace "output.at:273"
( $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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:273: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:273"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:273: \$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:273"
( $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:273"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:273: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"#.cc\" --defines=\"#.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:273"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "#.cc" --defines="#.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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:273: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"#.cc\" --defines=\"#.hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"#.cc\" --defines=\"#.hh\" cxx.y" "output.at:273"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "#.cc" --defines="#.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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:273: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:273"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:273: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:273"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:273: bison -fno-caret -o \"#.cc\" --defines=\"#.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:273"
( $at_check_trace; bison -fno-caret -o "#.cc" --defines="#.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:273"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:273: ls \"#.cc\" \"#.hh\""
at_fn_check_prepare_trace "output.at:273"
( $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:273"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:273: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:273"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:273"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:273: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"#.cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"#.cc\" " "output.at:273"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:273"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:274' \
  "Output file name: @@" "                           " 3
at_xfail=no
(
  $as_echo "99. $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
$as_echo "$at_srcdir/output.at:274: touch \"@@.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:274"
( $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:274"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:274: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:274"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@@.c" --defines="@@.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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:274: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y" "output.at:274"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "@@.c" --defines="@@.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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:274: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:274"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:274: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:274"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:274: bison -fno-caret -o \"@@.c\" --defines=\"@@.h\" glr.y"
at_fn_check_prepare_trace "output.at:274"
( $at_check_trace; bison -fno-caret -o "@@.c" --defines="@@.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:274"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:274: ls \"@@.c\" \"@@.h\""
at_fn_check_prepare_trace "output.at:274"
( $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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:274: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:274"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:274: \$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:274"
( $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:274"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:274: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@@.cc\" --defines=\"@@.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:274"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@@.cc" --defines="@@.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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:274: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@@.cc\" --defines=\"@@.hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@@.cc\" --defines=\"@@.hh\" cxx.y" "output.at:274"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "@@.cc" --defines="@@.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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:274: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:274"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:274: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:274"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:274: bison -fno-caret -o \"@@.cc\" --defines=\"@@.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:274"
( $at_check_trace; bison -fno-caret -o "@@.cc" --defines="@@.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:274"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:274: ls \"@@.cc\" \"@@.hh\""
at_fn_check_prepare_trace "output.at:274"
( $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:274"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:274: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:274"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:274"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:274: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@@.cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@@.cc\" " "output.at:274"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:274"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:275' \
  "Output file name: @{" "                           " 3
at_xfail=no
(
  $as_echo "100. $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
$as_echo "$at_srcdir/output.at:275: touch \"@{.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:275"
( $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:275"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:275: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:275"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@{.c" --defines="@{.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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:275: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y" "output.at:275"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "@{.c" --defines="@{.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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:275: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:275"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:275: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:275"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:275: bison -fno-caret -o \"@{.c\" --defines=\"@{.h\" glr.y"
at_fn_check_prepare_trace "output.at:275"
( $at_check_trace; bison -fno-caret -o "@{.c" --defines="@{.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:275"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:275: ls \"@{.c\" \"@{.h\""
at_fn_check_prepare_trace "output.at:275"
( $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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:275: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:275"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:275: \$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:275"
( $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:275"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:275: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@{.cc\" --defines=\"@{.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:275"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@{.cc" --defines="@{.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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:275: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@{.cc\" --defines=\"@{.hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@{.cc\" --defines=\"@{.hh\" cxx.y" "output.at:275"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "@{.cc" --defines="@{.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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:275: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:275"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:275: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:275"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:275: bison -fno-caret -o \"@{.cc\" --defines=\"@{.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:275"
( $at_check_trace; bison -fno-caret -o "@{.cc" --defines="@{.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:275"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:275: ls \"@{.cc\" \"@{.hh\""
at_fn_check_prepare_trace "output.at:275"
( $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:275"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:275: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:275"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:275"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:275: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@{.cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@{.cc\" " "output.at:275"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:275"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:276' \
  "Output file name: @}" "                           " 3
at_xfail=no
(
  $as_echo "101. $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
$as_echo "$at_srcdir/output.at:276: touch \"@}.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:276"
( $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:276"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:276: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:276"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@}.c" --defines="@}.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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:276: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y" "output.at:276"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "@}.c" --defines="@}.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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:276: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:276"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:276: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:276"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:276: bison -fno-caret -o \"@}.c\" --defines=\"@}.h\" glr.y"
at_fn_check_prepare_trace "output.at:276"
( $at_check_trace; bison -fno-caret -o "@}.c" --defines="@}.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:276"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:276: ls \"@}.c\" \"@}.h\""
at_fn_check_prepare_trace "output.at:276"
( $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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:276: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:276"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:276: \$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:276"
( $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:276"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:276: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@}.cc\" --defines=\"@}.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:276"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@}.cc" --defines="@}.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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:276: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@}.cc\" --defines=\"@}.hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"@}.cc\" --defines=\"@}.hh\" cxx.y" "output.at:276"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "@}.cc" --defines="@}.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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:276: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:276"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:276: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:276"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:276: bison -fno-caret -o \"@}.cc\" --defines=\"@}.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:276"
( $at_check_trace; bison -fno-caret -o "@}.cc" --defines="@}.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:276"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:276: ls \"@}.cc\" \"@}.hh\""
at_fn_check_prepare_trace "output.at:276"
( $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:276"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:276: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:276"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:276"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:276: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@}.cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@}.cc\" " "output.at:276"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:276"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:277' \
  "Output file name: [" "                            " 3
at_xfail=no
(
  $as_echo "102. $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
$as_echo "$at_srcdir/output.at:277: touch \"[.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:277"
( $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:277"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:277: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:277"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "[.c" --defines="[.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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:277: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y" "output.at:277"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "[.c" --defines="[.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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:277: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:277"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:277: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:277"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:277: bison -fno-caret -o \"[.c\" --defines=\"[.h\" glr.y"
at_fn_check_prepare_trace "output.at:277"
( $at_check_trace; bison -fno-caret -o "[.c" --defines="[.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:277"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:277: ls \"[.c\" \"[.h\""
at_fn_check_prepare_trace "output.at:277"
( $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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:277: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:277"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:277: \$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:277"
( $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:277"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:277: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"[.cc\" --defines=\"[.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:277"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "[.cc" --defines="[.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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:277: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"[.cc\" --defines=\"[.hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"[.cc\" --defines=\"[.hh\" cxx.y" "output.at:277"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "[.cc" --defines="[.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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:277: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:277"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:277: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:277"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:277: bison -fno-caret -o \"[.cc\" --defines=\"[.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:277"
( $at_check_trace; bison -fno-caret -o "[.cc" --defines="[.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:277"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:277: ls \"[.cc\" \"[.hh\""
at_fn_check_prepare_trace "output.at:277"
( $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:277"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:277: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:277"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:277"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:277: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"[.cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"[.cc\" " "output.at:277"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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: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_102
#AT_START_103
at_fn_group_banner 103 'output.at:278' \
  "Output file name: ]" "                            " 3
at_xfail=no
(
  $as_echo "103. $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
$as_echo "$at_srcdir/output.at:278: touch \"].tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:278"
( $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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "].c" --defines="].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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y" "output.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "].c" --defines="].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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:278: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:278"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:278: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:278"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:278: bison -fno-caret -o \"].c\" --defines=\"].h\" glr.y"
at_fn_check_prepare_trace "output.at:278"
( $at_check_trace; bison -fno-caret -o "].c" --defines="].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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:278: ls \"].c\" \"].h\""
at_fn_check_prepare_trace "output.at:278"
( $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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:278: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "output.at:278"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:278: \$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:278"
( $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:278"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/output.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"].cc\" --defines=\"].hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "].cc" --defines="].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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"].cc\" --defines=\"].hh\" cxx.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o \"].cc\" --defines=\"].hh\" cxx.y" "output.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o "].cc" --defines="].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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:278: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:278"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:278: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:278"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:278: bison -fno-caret -o \"].cc\" --defines=\"].hh\" cxx.y"
at_fn_check_prepare_trace "output.at:278"
( $at_check_trace; bison -fno-caret -o "].cc" --defines="].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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:278: ls \"].cc\" \"].hh\""
at_fn_check_prepare_trace "output.at:278"
( $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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:278: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:278"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:278: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"].cc\" "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"].cc\" " "output.at:278"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:278"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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:305' \
  "Graph with no conflicts" "                        " 3
at_xfail=no
(
  $as_echo "104. $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
$as_echo "$at_srcdir/output.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:305: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:305"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:305: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:305"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:305: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:305"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:305: bison -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:305"
( $at_check_trace; bison -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:305"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:305: grep -v // input.dot"
at_fn_check_prepare_trace "output.at:305"
( $at_check_trace; grep -v // input.dot
) >>"$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"; $as_echo "
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:305"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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:339' \
  "Graph with unsolved S/R" "                        " 3
at_xfail=no
(
  $as_echo "105. $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
$as_echo "$at_srcdir/output.at:339: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:339"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:339"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:339: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:339"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:339"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:339: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:339: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:339"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:339: bison -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; bison -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:339"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:339: grep -v // input.dot"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; grep -v // input.dot
) >>"$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"; $as_echo "
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: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_105
#AT_START_106
at_fn_group_banner 106 'output.at:403' \
  "Graph with solved S/R" "                          " 3
at_xfail=no
(
  $as_echo "106. $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
$as_echo "$at_srcdir/output.at:403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:403"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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
$as_echo "$at_srcdir/output.at:403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:403"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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
$as_echo "$at_srcdir/output.at:403: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:403: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:403"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:403: bison -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:403"
( $at_check_trace; bison -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
$as_echo "$at_srcdir/output.at:403: grep -v // input.dot"
at_fn_check_prepare_trace "output.at:403"
( $at_check_trace; grep -v // input.dot
) >>"$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"; $as_echo "
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: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_106
#AT_START_107
at_fn_group_banner 107 'output.at:462' \
  "Graph with R/R" "                                 " 3
at_xfail=no
(
  $as_echo "107. $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
$as_echo "$at_srcdir/output.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:462"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:462"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:462"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:462"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:462: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:462"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:462"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:462: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:462"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:462"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:462: bison -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:462"
( $at_check_trace; bison -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:462"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:462: grep -v // input.dot"
at_fn_check_prepare_trace "output.at:462"
( $at_check_trace; grep -v // input.dot
) >>"$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"; $as_echo "
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:462"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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:494' \
  "Graph with reductions with multiple LAT" "        " 3
at_xfail=no
(
  $as_echo "108. $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
$as_echo "$at_srcdir/output.at:494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:494"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:494"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:494"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:494"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:494: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:494"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:494"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:494: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:494"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:494"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:494: bison -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:494"
( $at_check_trace; bison -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:494"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:494: grep -v // input.dot"
at_fn_check_prepare_trace "output.at:494"
( $at_check_trace; grep -v // input.dot
) >>"$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"; $as_echo "
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:494"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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:553' \
  "Graph with a reduction rule both enabled and disabled" "" 3
at_xfail=no
(
  $as_echo "109. $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
$as_echo "$at_srcdir/output.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:553: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:553"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/output.at:553: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:553"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/output.at:553: bison -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:553"
( $at_check_trace; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:553: grep -v // input.dot"
at_fn_check_prepare_trace "output.at:553"
( $at_check_trace; grep -v // input.dot
) >>"$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"; $as_echo "
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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 'skeletons.at:24' \
  "Relative skeleton file names" "                   " 4
at_xfail=no
(
  $as_echo "110. $at_setup_line: testing $at_desc ..."
  $at_traceon


{ set +x
$as_echo "$at_srcdir/skeletons.at:26: mkdir tmp"
at_fn_check_prepare_trace "skeletons.at:26"
( $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:26"
$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
$as_echo "$at_srcdir/skeletons.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot tmp/input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:62"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:62: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y" "skeletons.at:62"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:62: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:62"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:62: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:62"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:62"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:62: bison -fno-caret tmp/input-gram.y"
at_fn_check_prepare_trace "skeletons.at:62"
( $at_check_trace; bison -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:62"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/skeletons.at:63: cat input-gram.tab.c"
at_fn_check_prepare_trace "skeletons.at:63"
( $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"; $as_echo "Hello World
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$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
$as_echo "$at_srcdir/skeletons.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:67"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:67: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input-gram.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input-gram.y" "skeletons.at:67"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:67: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:67"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:67: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:67"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:67"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:67: bison -fno-caret input-gram.y"
at_fn_check_prepare_trace "skeletons.at:67"
( $at_check_trace; bison -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:67"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/skeletons.at:68: cat input-gram.tab.c"
at_fn_check_prepare_trace "skeletons.at:68"
( $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"; $as_echo "Hello World -- Local
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$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
$as_echo "$at_srcdir/skeletons.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:72"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:72: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" "skeletons.at:72"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:72: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:72"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:72: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:72"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:72: bison -fno-caret --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:72"
( $at_check_trace; bison -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:72"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/skeletons.at:73: cat input-cmd-line.tab.c"
at_fn_check_prepare_trace "skeletons.at:73"
( $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"; $as_echo "Hello World
" | \
  $at_diff - "$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
  $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 'skeletons.at:84' \
  "Installed skeleton file names" "                  " 4
at_xfail=no
(
  $as_echo "111. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >input-cmd-line.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (void);
%}

%error-verbose
%token 'a'

%%

start: ;

%%



/* A C error reporting function.  */
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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "yacc.c"
%{
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (void);
%}

%error-verbose
%token 'a'

%%

start: ;

%%



/* A C error reporting function.  */
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
$as_echo "$at_srcdir/skeletons.at:119: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:119"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:119"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:119: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" "skeletons.at:119"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:119"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:119: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:119"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:119"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:119: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:119"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:119"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:119: bison -fno-caret --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:119"
( $at_check_trace; bison -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:119"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/skeletons.at:120: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:120"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/skeletons.at:120: \$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:120"
( $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:120"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:121:  \$PREPARSER ./input-cmd-line"
at_fn_check_prepare_dynamic " $PREPARSER ./input-cmd-line" "skeletons.at:121"
( $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:121"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:121: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "skeletons.at:121"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected 'a', expecting \$end
" | \
  $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:121"
$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
$as_echo "$at_srcdir/skeletons.at:125: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input-gram.c input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:125"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:125"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:125: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y" "skeletons.at:125"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:125"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:125: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:125"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:125"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:125: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:125"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:125"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:125: bison -fno-caret -o input-gram.c input-gram.y"
at_fn_check_prepare_trace "skeletons.at:125"
( $at_check_trace; bison -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:125"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/skeletons.at:126: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "skeletons.at:126"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/skeletons.at:126: \$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:126"
( $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:126"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:127:  \$PREPARSER ./input-gram"
at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:127"
( $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:127"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:127: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "skeletons.at:127"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected 'a', expecting \$end
" | \
  $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: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_111
#AT_START_112
at_fn_group_banner 112 'skeletons.at:141' \
  "Boolean=variables: invalid skeleton defaults" "   " 4
at_xfail=no
(
  $as_echo "112. $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
$as_echo "$at_srcdir/skeletons.at:154: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "skeletons.at:154"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "<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: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_112
#AT_START_113
at_fn_group_banner 113 'skeletons.at:165' \
  "Complaining during macro argument expansion" "    " 4
at_xfail=no
(
  $as_echo "113. $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
$as_echo "$at_srcdir/skeletons.at:188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input1.y" "skeletons.at:188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:188"
$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
$as_echo "$at_srcdir/skeletons.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input2.y" "skeletons.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:208"
$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
$as_echo "$at_srcdir/skeletons.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input3.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input3.y" "skeletons.at:222"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:222"
$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
$as_echo "$at_srcdir/skeletons.at:236: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input4.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input4.y" "skeletons.at:236"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:236"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'skeletons.at:247' \
  "Fatal errors make M4 exit immediately" "          " 4
at_xfail=no
(
  $as_echo "114. $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
$as_echo "$at_srcdir/skeletons.at:261: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input1.y" "skeletons.at:261"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:261"
$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
$as_echo "$at_srcdir/skeletons.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input2.y" "skeletons.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:278"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'skeletons.at:301' \
  "Fatal errors but M4 continues producing output" " " 4
at_xfail=no
(
  $as_echo "115. $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
$as_echo "$at_srcdir/skeletons.at:313: \$PERL gen-skel.pl > skel.c || exit 77"
at_fn_check_prepare_dynamic "$PERL gen-skel.pl > skel.c || exit 77" "skeletons.at:313"
( $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:313"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%skeleton "./skel.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:321: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "skeletons.at:321"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:321"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'sets.at:66' \
  "Nullable" "                                       " 5
at_xfail=no
(
  $as_echo "116. $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
$as_echo "$at_srcdir/sets.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:81: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:81"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/sets.at:81: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:81"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/sets.at:81: bison -fno-caret --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:81"
( $at_check_trace; bison -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:81"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >extract.sed <<'_ATEOF'
#n
/^NULLABLE$/ {
   :null
   p
   n
   /^ *$/ !b null
}
/^FIRSTS$/ {
   :firsts
   p
   n
   /^ *$/ !b firsts
}
/^FDERIVES$/ {
   :fderiv
   p
   n
   /^ *$/ !b fderiv
}
/^DERIVES$/ {
   :deriv
   p
   n
   /^ *$/ !b deriv
}
_ATEOF

{ set +x
$as_echo "$at_srcdir/sets.at:82: sed -f extract.sed stderr"
at_fn_check_prepare_trace "sets.at:82"
( $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 stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/sets.at:82: mv stdout sets"
at_fn_check_prepare_trace "sets.at:82"
( $at_check_trace; mv stdout sets
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:82"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/sets.at:83: cat sets"
at_fn_check_prepare_trace "sets.at:83"
( $at_check_trace; cat sets
) >>"$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"; $as_echo "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:83"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'sets.at:151' \
  "Broken Closure" "                                 " 5
at_xfail=no
(
  $as_echo "117. $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
$as_echo "$at_srcdir/sets.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:165"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:165"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:165: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:165"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:165"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/sets.at:165: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:165"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:165"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/sets.at:165: bison -fno-caret --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:165"
( $at_check_trace; bison -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:165"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/sets.at:167: 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:167"
( $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"; $as_echo "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: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_117
#AT_START_118
at_fn_group_banner 118 'sets.at:193' \
  "Firsts" "                                         " 5
at_xfail=no
(
  $as_echo "118. $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
$as_echo "$at_srcdir/sets.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:211: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:211"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/sets.at:211: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:211"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/sets.at:211: bison -fno-caret --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:211"
( $at_check_trace; bison -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:211"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >extract.sed <<'_ATEOF'
#n
/^NULLABLE$/ {
   :null
   p
   n
   /^ *$/ !b null
}
/^FIRSTS$/ {
   :firsts
   p
   n
   /^ *$/ !b firsts
}
/^FDERIVES$/ {
   :fderiv
   p
   n
   /^ *$/ !b fderiv
}
/^DERIVES$/ {
   :deriv
   p
   n
   /^ *$/ !b deriv
}
_ATEOF

{ set +x
$as_echo "$at_srcdir/sets.at:212: sed -f extract.sed stderr"
at_fn_check_prepare_trace "sets.at:212"
( $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 stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:212"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/sets.at:212: mv stdout sets"
at_fn_check_prepare_trace "sets.at:212"
( $at_check_trace; mv stdout sets
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:212"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/sets.at:213: cat sets"
at_fn_check_prepare_trace "sets.at:213"
( $at_check_trace; cat sets
) >>"$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"; $as_echo "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: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_118
#AT_START_119
at_fn_group_banner 119 'sets.at:269' \
  "Accept" "                                         " 5
at_xfail=no
(
  $as_echo "119. $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
$as_echo "$at_srcdir/sets.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "sets.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:281: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:281"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/sets.at:281: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:281"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/sets.at:281: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "sets.at:281"
( $at_check_trace; bison -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }



# Get the final state in the parser.
{ set +x
$as_echo "$at_srcdir/sets.at:284: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c"
at_fn_check_prepare_trace "sets.at:284"
( $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:284"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout expout

# Get the final state in the report, from the "accept" action..
{ set +x
$as_echo "$at_srcdir/sets.at:289: sed -n '
           /^State \\(.*\\)/{
             s//final state \\1/
             x
           }
           / accept/{
             x
             p
             q
           }
        ' input.output"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:289"
( $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:289"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'reduce.at:25' \
  "Useless Terminals" "                              " 6
at_xfail=no
(
  $as_echo "120. $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
$as_echo "$at_srcdir/reduce.at:46: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:46"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:46"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:46: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:46"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:46"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:46: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:46"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:46"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:46: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:46"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:46"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:46: bison -fno-caret input.y"
at_fn_check_prepare_trace "reduce.at:46"
( $at_check_trace; bison -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:46"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:48: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:48"
( $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"; $as_echo "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:48"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'reduce.at:69' \
  "Useless Nonterminals" "                           " 6
at_xfail=no
(
  $as_echo "121. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%verbose
%output "input.c"

%nterm useless1
%nterm useless2
%nterm useless3
%nterm useless4
%nterm useless5
%nterm useless6
%nterm useless7
%nterm useless8
%nterm 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
$as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:90"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:90: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:90"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:90: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:90"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:90: bison -fno-caret input.y"
at_fn_check_prepare_trace "reduce.at:90"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar [-Wother]
input.y:4.8-15: warning: nonterminal useless in grammar: useless1 [-Wother]
input.y:5.8-15: warning: nonterminal useless in grammar: useless2 [-Wother]
input.y:6.8-15: warning: nonterminal useless in grammar: useless3 [-Wother]
input.y:7.8-15: warning: nonterminal useless in grammar: useless4 [-Wother]
input.y:8.8-15: warning: nonterminal useless in grammar: useless5 [-Wother]
input.y:9.8-15: warning: nonterminal useless in grammar: useless6 [-Wother]
input.y:10.8-15: warning: nonterminal useless in grammar: useless7 [-Wother]
input.y:11.8-15: warning: nonterminal useless in grammar: useless8 [-Wother]
input.y:12.8-15: warning: nonterminal useless in grammar: useless9 [-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:90"
$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
$as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "reduce.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:4.8-15: warning: nonterminal useless in grammar: useless1 [-Wother]
input.y:5.8-15: warning: nonterminal useless in grammar: useless2 [-Wother]
input.y:6.8-15: warning: nonterminal useless in grammar: useless3 [-Wother]
input.y:7.8-15: warning: nonterminal useless in grammar: useless4 [-Wother]
input.y:8.8-15: warning: nonterminal useless in grammar: useless5 [-Wother]
input.y:9.8-15: warning: nonterminal useless in grammar: useless6 [-Wother]
input.y:10.8-15: warning: nonterminal useless in grammar: useless7 [-Wother]
input.y:11.8-15: warning: nonterminal useless in grammar: useless8 [-Wother]
input.y:12.8-15: warning: nonterminal useless in grammar: useless9 [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/reduce.at:90: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:90"
( $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:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "reduce.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "reduce.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "reduce.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/reduce.at:103: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:103"
( $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"; $as_echo "Nonterminals useless 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:103"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'reduce.at:124' \
  "Useless Rules" "                                  " 6
at_xfail=no
(
  $as_echo "122. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%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
$as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:145"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:145"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:145"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:145: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:145"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:145: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:145"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:145: bison -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "reduce.at:145"
( $at_check_trace; bison -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar [-Wother]
input.y: warning: 9 rules useless in grammar [-Wother]
input.y:6.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
 useless1: '1';
 ^^^^^^^^
input.y:7.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
 useless2: '2';
 ^^^^^^^^
input.y:8.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
 useless3: '3';
 ^^^^^^^^
input.y:9.1-8: warning: nonterminal useless in grammar: useless4 [-Wother]
 useless4: '4';
 ^^^^^^^^
input.y:10.1-8: warning: nonterminal useless in grammar: useless5 [-Wother]
 useless5: '5';
 ^^^^^^^^
input.y:11.1-8: warning: nonterminal useless in grammar: useless6 [-Wother]
 useless6: '6';
 ^^^^^^^^
input.y:12.1-8: warning: nonterminal useless in grammar: useless7 [-Wother]
 useless7: '7';
 ^^^^^^^^
input.y:13.1-8: warning: nonterminal useless in grammar: useless8 [-Wother]
 useless8: '8';
 ^^^^^^^^
input.y:14.1-8: warning: nonterminal useless in grammar: useless9 [-Wother]
 useless9: '9';
 ^^^^^^^^
input.y:6.11-13: warning: rule useless in grammar [-Wother]
 useless1: '1';
           ^^^
input.y:7.11-13: warning: rule useless in grammar [-Wother]
 useless2: '2';
           ^^^
input.y:8.11-13: warning: rule useless in grammar [-Wother]
 useless3: '3';
           ^^^
input.y:9.11-13: warning: rule useless in grammar [-Wother]
 useless4: '4';
           ^^^
input.y:10.11-13: warning: rule useless in grammar [-Wother]
 useless5: '5';
           ^^^
input.y:11.11-13: warning: rule useless in grammar [-Wother]
 useless6: '6';
           ^^^
input.y:12.11-13: warning: rule useless in grammar [-Wother]
 useless7: '7';
           ^^^
input.y:13.11-13: warning: rule useless in grammar [-Wother]
 useless8: '8';
           ^^^
input.y:14.11-13: warning: rule useless in grammar [-Wother]
 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:145"
$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
$as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Werror" "reduce.at:145"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:145"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:6.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
 useless1: '1';
 ^^^^^^^^
input.y:7.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
 useless2: '2';
 ^^^^^^^^
input.y:8.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
 useless3: '3';
 ^^^^^^^^
input.y:9.1-8: warning: nonterminal useless in grammar: useless4 [-Wother]
 useless4: '4';
 ^^^^^^^^
input.y:10.1-8: warning: nonterminal useless in grammar: useless5 [-Wother]
 useless5: '5';
 ^^^^^^^^
input.y:11.1-8: warning: nonterminal useless in grammar: useless6 [-Wother]
 useless6: '6';
 ^^^^^^^^
input.y:12.1-8: warning: nonterminal useless in grammar: useless7 [-Wother]
 useless7: '7';
 ^^^^^^^^
input.y:13.1-8: warning: nonterminal useless in grammar: useless8 [-Wother]
 useless8: '8';
 ^^^^^^^^
input.y:14.1-8: warning: nonterminal useless in grammar: useless9 [-Wother]
 useless9: '9';
 ^^^^^^^^
input.y:6.11-13: warning: rule useless in grammar [-Wother]
 useless1: '1';
           ^^^
input.y:7.11-13: warning: rule useless in grammar [-Wother]
 useless2: '2';
           ^^^
input.y:8.11-13: warning: rule useless in grammar [-Wother]
 useless3: '3';
           ^^^
input.y:9.11-13: warning: rule useless in grammar [-Wother]
 useless4: '4';
           ^^^
input.y:10.11-13: warning: rule useless in grammar [-Wother]
 useless5: '5';
           ^^^
input.y:11.11-13: warning: rule useless in grammar [-Wother]
 useless6: '6';
           ^^^
input.y:12.11-13: warning: rule useless in grammar [-Wother]
 useless7: '7';
           ^^^
input.y:13.11-13: warning: rule useless in grammar [-Wother]
 useless8: '8';
           ^^^
input.y:14.11-13: warning: rule useless in grammar [-Wother]
 useless9: '9';
           ^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/reduce.at:145: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:145"
( $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:145"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=error" "reduce.at:145"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:145"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror" "reduce.at:145"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:145: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror" "reduce.at:145"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:145"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi


{ set +x
$as_echo "$at_srcdir/reduce.at:205: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:205"
( $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"; $as_echo "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:205"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'reduce.at:249' \
  "Reduced Automaton" "                              " 6
at_xfail=no
(
  $as_echo "123. $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
$as_echo "$at_srcdir/reduce.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret not-reduced.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y" "reduce.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:278: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:278"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:278: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:278"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:278: bison -fno-caret -fcaret not-reduced.y"
at_fn_check_prepare_trace "reduce.at:278"
( $at_check_trace; bison -fno-caret -fcaret not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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]
 not_reachable: useful  { /* A not reachable action. */ }
 ^^^^^^^^^^^^^
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive [-Wother]
    | non_productive    { /* A non productive action. */ }
      ^^^^^^^^^^^^^^
not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother]
    | non_productive    { /* A non productive action. */ }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not-reduced.y:14.16-56: warning: rule useless in grammar [-Wother]
 not_reachable: useful  { /* A not reachable action. */ }
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not-reduced.y:17.17-18.63: warning: rule useless in grammar [-Wother]
 non_productive: non_productive useless_token
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
" | \
  $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:278"
$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
$as_echo "$at_srcdir/reduce.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y -Werror" "reduce.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
 not_reachable: useful  { /* A not reachable action. */ }
 ^^^^^^^^^^^^^
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive [-Wother]
    | non_productive    { /* A non productive action. */ }
      ^^^^^^^^^^^^^^
not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother]
    | non_productive    { /* A non productive action. */ }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not-reduced.y:14.16-56: warning: rule useless in grammar [-Wother]
 not_reachable: useful  { /* A not reachable action. */ }
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not-reduced.y:17.17-18.63: warning: rule useless in grammar [-Wother]
 non_productive: non_productive useless_token
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/reduce.at:278: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:278"
( $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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/reduce.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y --warnings=error" "reduce.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/reduce.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y -Wnone -Werror" "reduce.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:278: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y --warnings=none -Werror" "reduce.at:278"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret not-reduced.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:278"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/reduce.at:298: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' not-reduced.output" "reduce.at:298"
( $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"; $as_echo "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:298"
$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
$as_echo "$at_srcdir/reduce.at:335: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot reduced.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:335"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:335"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:335: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml reduced.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml reduced.y" "reduce.at:335"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:335"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:335: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:335"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:335"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:335: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:335"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:335"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:335: bison -fno-caret reduced.y"
at_fn_check_prepare_trace "reduce.at:335"
( $at_check_trace; bison -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:335"
$at_failed && at_fn_log_failure
$at_traceon; }



# Comparing the parsers.
cp reduced.c expout
{ set +x
$as_echo "$at_srcdir/reduce.at:339: sed 's/not-reduced/reduced/g' not-reduced.c"
at_fn_check_prepare_trace "reduce.at:339"
( $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: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_123
#AT_START_124
at_fn_group_banner 124 'reduce.at:349' \
  "Underivable Rules" "                              " 6
at_xfail=no
(
  $as_echo "124. $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
$as_echo "$at_srcdir/reduce.at:363: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:363"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:363"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:363: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:363"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:363"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:363: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:363"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:363"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:363: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:363"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:363"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:363: bison -fno-caret input.y"
at_fn_check_prepare_trace "reduce.at:363"
( $at_check_trace; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar [-Wother]
input.y: warning: 3 rules useless in grammar [-Wother]
input.y:5.15-25: warning: nonterminal useless in grammar: underivable [-Wother]
input.y:6.14-24: warning: nonterminal useless in grammar: indirection [-Wother]
input.y:5.15-25: warning: rule useless in grammar [-Wother]
input.y:6.14-24: warning: rule useless in grammar [-Wother]
input.y:7.14-24: warning: rule useless in grammar [-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:363"
$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
$as_echo "$at_srcdir/reduce.at:363: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Werror" "reduce.at:363"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:363"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:5.15-25: warning: nonterminal useless in grammar: underivable [-Wother]
input.y:6.14-24: warning: nonterminal useless in grammar: indirection [-Wother]
input.y:5.15-25: warning: rule useless in grammar [-Wother]
input.y:6.14-24: warning: rule useless in grammar [-Wother]
input.y:7.14-24: warning: rule useless in grammar [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/reduce.at:363: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:363"
( $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:363"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/reduce.at:363: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=error" "reduce.at:363"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:363"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/reduce.at:363: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror" "reduce.at:363"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:363"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:363: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror" "reduce.at:363"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:363"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/reduce.at:373: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:373"
( $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"; $as_echo "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: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_124
#AT_START_125
at_fn_group_banner 125 'reduce.at:391' \
  "Empty Language" "                                 " 6
at_xfail=no
(
  $as_echo "125. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%output "input.c"
%%
exp: exp;
_ATEOF



{ set +x
$as_echo "$at_srcdir/reduce.at:399: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "reduce.at:399"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar [-Wother]
input.y: warning: 2 rules useless in grammar [-Wother]
input.y:3.1-3: fatal 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: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_125
#AT_START_126
at_fn_group_banner 126 'reduce.at:442' \
  "no lr.type: Single State Split" "                 " 6
at_xfail=no
(
  $as_echo "126. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:442: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:442"
( $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"; $as_echo "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:442"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:442"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$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:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:442:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; sed >&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"; $as_echo "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:442"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:442' \
  "lr.type=lalr: Single State Split" "               " 6
at_xfail=no
(
  $as_echo "127. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:442: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:442"
( $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"; $as_echo "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:442"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:442"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$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:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:442:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; sed >&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"; $as_echo "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:442"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:442' \
  "lr.type=ielr: Single State Split" "               " 6
at_xfail=no
(
  $as_echo "128. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:442: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:442"
( $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"; $as_echo "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:442"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:442"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$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:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:442:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; 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:442"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:442' \
  "lr.type=canonical-lr: Single State Split" "       " 6
at_xfail=no
(
  $as_echo "129. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:442: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:442"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:442"
( $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"; $as_echo "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:442"
$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 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
{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:442"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: \$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:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:442:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:442"
( $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:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:442: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:442"
( $at_check_trace; 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:442"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:675' \
  "no lr.type: Lane Split" "                         " 6
at_xfail=no
(
  $as_echo "130. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:675: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:675"
( $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"; $as_echo "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:675"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:675"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$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:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:675:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; sed >&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"; $as_echo "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:675"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:675' \
  "lr.type=lalr: Lane Split" "                       " 6
at_xfail=no
(
  $as_echo "131. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:675: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:675"
( $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"; $as_echo "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:675"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:675"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$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:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:675:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; sed >&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"; $as_echo "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:675"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:675' \
  "lr.type=ielr: Lane Split" "                       " 6
at_xfail=no
(
  $as_echo "132. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:675: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:675"
( $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"; $as_echo "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:675"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:675"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$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:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:675:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; 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:675"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:675' \
  "lr.type=canonical-lr: Lane Split" "               " 6
at_xfail=no
(
  $as_echo "133. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:675: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:675"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:675: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:675"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:675"
( $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"; $as_echo "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:675"
$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 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
{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:675"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: \$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:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:675:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:675"
( $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:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:675: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:675"
( $at_check_trace; 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:675"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:919' \
  "no lr.type: Complex Lane Split" "                 " 6
at_xfail=no
(
  $as_echo "134. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:919: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:919"
( $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"; $as_echo "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:919"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:919"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$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:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:919:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; sed >&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"; $as_echo "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:919"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:919' \
  "lr.type=lalr: Complex Lane Split" "               " 6
at_xfail=no
(
  $as_echo "135. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:919: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:919"
( $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"; $as_echo "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:919"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:919"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$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:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:919:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; sed >&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"; $as_echo "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:919"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:919' \
  "lr.type=ielr: Complex Lane Split" "               " 6
at_xfail=no
(
  $as_echo "136. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:919: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:919"
( $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"; $as_echo "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:919"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:919"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$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:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:919:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; 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:919"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:919' \
  "lr.type=canonical-lr: Complex Lane Split" "       " 6
at_xfail=no
(
  $as_echo "137. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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 paser 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.  */
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
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:919: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:919"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:919: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:919"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:919: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:919"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:919"
( $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"; $as_echo "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:919"
$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 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
{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:919"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: \$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:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:919:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:919"
( $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:919"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:919: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:919"
( $at_check_trace; 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:919"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1188' \
  "no lr.type: Split During Added Lookahead Propagation" "" 6
at_xfail=no
(
  $as_echo "138. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1188: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $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:1188"
$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
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1188"
( $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"; $as_echo "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:1188"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1188"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$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:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1188:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; sed >&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"; $as_echo "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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1188' \
  "lr.type=lalr: Split During Added Lookahead Propagation" "" 6
at_xfail=no
(
  $as_echo "139. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1188: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $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:1188"
$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
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1188"
( $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"; $as_echo "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:1188"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1188"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$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:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1188:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; sed >&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"; $as_echo "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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1188' \
  "lr.type=ielr: Split During Added Lookahead Propagation" "" 6
at_xfail=no
(
  $as_echo "140. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1188: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1188"
( $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"; $as_echo "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:1188"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1188"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$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:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1188:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; 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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1188' \
  "lr.type=canonical-lr: Split During Added Lookahead Propagation" "" 6
at_xfail=no
(
  $as_echo "141. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1188: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1188"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1188: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1188"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1188: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1188"
( $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"; $as_echo "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:1188"
$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 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
{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1188"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: \$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:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1188:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1188"
( $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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1188: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1188"
( $at_check_trace; 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:1188"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1518' \
  "no lr.default-reduction" "                        " 6
at_xfail=no
(
  $as_echo "142. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1518: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1518"
( $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"; $as_echo "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:1518"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1518"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$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:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1518:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; 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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1518' \
  "lr.default-reduction=most" "                      " 6
at_xfail=no
(
  $as_echo "143. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1518: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1518"
( $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"; $as_echo "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:1518"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1518"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$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:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1518:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; 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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1518' \
  "lr.default-reduction=consistent" "                " 6
at_xfail=no
(
  $as_echo "144. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1518: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1518"
( $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"; $as_echo "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:1518"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1518"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$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:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1518:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; 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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'reduce.at:1518' \
  "lr.default-reduction=accepting" "                 " 6
at_xfail=no
(
  $as_echo "145. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

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.  */
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
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:1518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/reduce.at:1518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:1518: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1518"
( $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"; $as_echo "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:1518"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "reduce.at:1518"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: \$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:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:1518:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1518"
( $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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/reduce.at:1518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1518"
( $at_check_trace; 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:1518"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'conflicts.at:27' \
  "Token declaration order" "                        " 7
at_xfail=no
(
  $as_echo "146. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
  #include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/conflicts.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:80"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:80: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:80"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:80: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:80"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:80: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:80"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:80: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:80"
( $at_check_trace; bison -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:80"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:81: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:81"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/conflicts.at:81: \$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:81"
( $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:81"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:83:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:83"
( $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:83"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:83: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:83"
( $at_check_trace; 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:83"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'conflicts.at:100' \
  "Token declaration order: literals vs. identifiers" "" 7
at_xfail=no
(
  $as_echo "147. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/conflicts.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:128: bison -fno-caret --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:129: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:129"
( $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"; $as_echo "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: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_147
#AT_START_148
at_fn_group_banner 148 'conflicts.at:180' \
  "Useless associativity warning" "                  " 7
at_xfail=no
(
  $as_echo "148. $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
$as_echo "$at_srcdir/conflicts.at:202: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wprecedence input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:202"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:202"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:202: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y" "conflicts.at:202"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:202"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:202: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:202"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:202"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:202: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:202"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:202"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:202: bison -fno-caret -Wprecedence input.y"
at_fn_check_prepare_trace "conflicts.at:202"
( $at_check_trace; bison -fno-caret -Wprecedence input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:202"
$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
$as_echo "$at_srcdir/conflicts.at:202: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y -Werror" "conflicts.at:202"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:202"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:202: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:202"
( $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:202"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:202: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y --warnings=error" "conflicts.at:202"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:202"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:202: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y -Wnone -Werror" "conflicts.at:202"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:202"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:202: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y --warnings=none -Werror" "conflicts.at:202"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:202"
$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_148
#AT_START_149
at_fn_group_banner 149 'conflicts.at:215' \
  "Useless precedence warning" "                     " 7
at_xfail=no
(
  $as_echo "149. $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
$as_echo "$at_srcdir/conflicts.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wprecedence -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y" "conflicts.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:245: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:245"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:245: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:245"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:245: bison -fno-caret -Wprecedence -fcaret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:245"
( $at_check_trace; bison -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"; $as_echo "input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence]
 %nonassoc U
 ^^^^^^^^^
input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence]
 %right V
 ^^^^^^
input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence]
 %left W
 ^^^^^
input.y:2.1-11: warning: useless precedence for Z [-Wprecedence]
 %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:245"
$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
$as_echo "$at_srcdir/conflicts.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror" "conflicts.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
 %nonassoc U
 ^^^^^^^^^
input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence]
 %right V
 ^^^^^^
input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence]
 %left W
 ^^^^^
input.y:2.1-11: warning: useless precedence for Z [-Wprecedence]
 %precedence Z
 ^^^^^^^^^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:245: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:245"
( $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:245"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error" "conflicts.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone -Werror" "conflicts.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror" "conflicts.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:245"
$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_149
#AT_START_150
at_fn_group_banner 150 'conflicts.at:272' \
  "S/R in initial" "                                 " 7
at_xfail=no
(
  $as_echo "150. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%expect 1
%%
exp: e 'e';
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
$as_echo "$at_srcdir/conflicts.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:281: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:281"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:281: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:281"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:281: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:281"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:4.9: 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:281"
$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
$as_echo "$at_srcdir/conflicts.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "conflicts.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:281: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:281"
( $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:281"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "conflicts.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:281"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "conflicts.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:281"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:281: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "conflicts.at:281"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:281"
$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
$as_echo "$at_srcdir/conflicts.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:285"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "conflicts.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:285"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:285: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:285"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:285"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:285: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:285"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:285"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:285: bison -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:285"
( $at_check_trace; bison -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"; $as_echo "input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
 e: 'e' | /* Nothing. */;
         ^
" | \
  $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:285"
$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
$as_echo "$at_srcdir/conflicts.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" "conflicts.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:285"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
 e: 'e' | /* Nothing. */;
         ^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:285: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:285"
( $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:285"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" "conflicts.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:285"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" "conflicts.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:285"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" "conflicts.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:285"
$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_150
#AT_START_151
at_fn_group_banner 151 'conflicts.at:298' \
  "%nonassoc and eof" "                              " 7
at_xfail=no
(
  $as_echo "151. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYERROR_VERBOSE 1


/* A C error reporting function.  */
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++];
}

%}

%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
$as_echo "$at_srcdir/conflicts.at:364: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:364"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  -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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:364: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml  -o input.c input.y" "conflicts.at:364"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:364: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:364"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:364: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:364"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:364: bison -fno-caret  -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:364"
( $at_check_trace; bison -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:364"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:364: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:364"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:364: \$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:364"
( $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:364"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:364:  \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:364"
( $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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:364"
( $at_check_trace; 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:364"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:364:  \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:364"
( $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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:364"
( $at_check_trace; sed >&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"; $as_echo "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:364"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:364:  \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:364"
( $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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:364"
( $at_check_trace; 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:364"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:364:  \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:364"
( $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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:364"
( $at_check_trace; sed >&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"; $as_echo "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:364"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:364:  \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:364"
( $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:364"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:364"
( $at_check_trace; sed >&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"; $as_echo "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:364"
$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
$as_echo "$at_srcdir/conflicts.at:368: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dlr.default-reduction=consistent -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:368"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:368"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:368: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y" "conflicts.at:368"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:368"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:368: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:368: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:368"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:368: bison -fno-caret -Dlr.default-reduction=consistent -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; bison -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:368"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:368: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:368"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$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
$as_echo "$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
$as_echo "$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
$as_echo "$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
$as_echo "$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"; $as_echo "syntax error, unexpected '<', expecting \$end
" | \
  $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
$as_echo "$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
$as_echo "$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
$as_echo "$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
$as_echo "$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"; $as_echo "syntax error, unexpected '>', expecting \$end
" | \
  $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
$as_echo "$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
$as_echo "$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"; $as_echo "syntax error, unexpected '>', expecting \$end
" | \
  $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; }





# 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
$as_echo "$at_srcdir/conflicts.at:377: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:377"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:377: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:377"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:377: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:377"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:377: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:377"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:377: bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:377"
( $at_check_trace; bison -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:377"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:377: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:377"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:377: \$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:377"
( $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:377:  \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:377"
( $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:377"
( $at_check_trace; 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:377"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:377:  \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:377"
( $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:377"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '<', expecting \$end
" | \
  $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:377:  \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:377"
( $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:377"
( $at_check_trace; 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:377"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:377:  \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:377"
( $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:377"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '>', expecting \$end
" | \
  $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:377:  \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:377"
( $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:377"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:377"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '>', expecting \$end
" | \
  $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:377"
$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
$as_echo "$at_srcdir/conflicts.at:384: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:384"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:384: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" "conflicts.at:384"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:384: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:384"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:384: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:384"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:384: bison -fno-caret -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:384"
( $at_check_trace; bison -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:384"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:384: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:384"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:384: \$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:384"
( $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:384:  \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:384"
( $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:384: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:384"
( $at_check_trace; 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:384"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:384:  \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:384"
( $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:384: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:384"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '<', expecting \$end
" | \
  $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:384:  \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:384"
( $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:384: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:384"
( $at_check_trace; 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:384"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:384:  \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:384"
( $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:384: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:384"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '>', expecting \$end
" | \
  $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:384:  \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:384"
( $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:384: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:384"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '>', expecting \$end
" | \
  $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:384"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:522' \
  "parse.error=verbose and consistent errors: lr.type=ielr" "" 7
at_xfail=no
(
  $as_echo "152. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:522: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:522"
( $at_check_trace; bison -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:522"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:522: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:522"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:522: \$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:522"
( $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:522"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:522:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:522"
( $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:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:522: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:522"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end
" | \
  $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:522"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:526' \
  "parse.error=verbose and consistent errors: lr.type=ielr %glr-parser" "" 7
at_xfail=no
(
  $as_echo "153. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:526"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:526"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:526"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:526: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:526"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:526: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:526"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:526: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:526"
( $at_check_trace; bison -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:526"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:526: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:526"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:526"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:526: \$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:526"
( $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:526"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:526:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:526"
( $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:526"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:526"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end
" | \
  $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:526"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:531' \
  "parse.error=verbose and consistent errors: lr.type=ielr c++" "" 7
at_xfail=no
(
  $as_echo "154. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <string>
  int yylex (yy::parser::semantic_type *lvalp);
  #define USE(Var)
}

%defines

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (yy::parser::semantic_type *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}


/*-------.
| 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
$as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:531"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:531"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:531"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:531"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:531: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:531"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:531: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:531"
( $at_check_trace; bison -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:531"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:531: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "conflicts.at:531"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:531"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:531: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:531"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:531"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:531:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:531"
( $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:531"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:531: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:531"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end
" | \
  $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:531"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:536' \
  "parse.error=verbose and consistent errors: lr.type=ielr java" "" 7
at_xfail=no
(
  $as_echo "155. $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 s)
  {
    System.err.println (s);
  }


};

%%

/*-------.
| main.  |
`-------*/
class input
{
  public static void main (String args[]) throws IOException
  {
    YYParser p = new YYParser ();
    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
$as_echo "$at_srcdir/conflicts.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:536"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "conflicts.at:536"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:536"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:536: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:536"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:536: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:536"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:536: bison -fno-caret -o input.java input.y"
at_fn_check_prepare_trace "conflicts.at:536"
( $at_check_trace; bison -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:536"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "conflicts.at:536" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/conflicts.at:536"
$as_echo "conflicts.at:536" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/conflicts.at:536"
{ set +x
$as_echo "$at_srcdir/conflicts.at:536: \$SHELL ../../../javacomp.sh input.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "conflicts.at:536"
( $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:536"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:536:  \$SHELL ../../../javaexec.sh input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "conflicts.at:536"
( $at_check_trace;  $SHELL ../../../javaexec.sh input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected end of input
" | \
  $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: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_155
#AT_START_156
at_fn_group_banner 156 'conflicts.at:543' \
  "parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=consistent" "" 7
at_xfail=no
(
  $as_echo "156. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:543"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:543: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:543"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:543: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:543"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:543: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:543"
( $at_check_trace; bison -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:543"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:543: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:543"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:543"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:543: \$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:543"
( $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:543"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:543:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:543"
( $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:543"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:543: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:543"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end, 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:543"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:548' \
  "parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=accepting" "" 7
at_xfail=no
(
  $as_echo "157. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:548"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:548"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:548"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:548"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:548: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:548"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:548"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:548: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:548"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:548"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:548: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:548"
( $at_check_trace; bison -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:548"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:548: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:548"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:548"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:548: \$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:548"
( $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:548"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:548:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:548"
( $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:548"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:548: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:548"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end, 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:548"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:553' \
  "parse.error=verbose and consistent errors: lr.type=canonical-lr" "" 7
at_xfail=no
(
  $as_echo "158. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:553: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:553"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:553: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:553"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:553: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:553"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:553: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:553"
( $at_check_trace; bison -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:553"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:553: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:553"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:553: \$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:553"
( $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:553"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:553:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:553"
( $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:553"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:553: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:553"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end, 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:553"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:559' \
  "parse.error=verbose and consistent errors: lr.type=canonical-lr parse.lac=full" "" 7
at_xfail=no
(
  $as_echo "159. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:559"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:559"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:559: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:559"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:559"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:559: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:559"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:559"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:559: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:559"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:559"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:559: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:559"
( $at_check_trace; bison -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:559"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:559: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:559"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:559"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:559: \$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:559"
( $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:559"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:559:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:559"
( $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:559"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:559: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:559"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end, 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: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_159
#AT_START_160
at_fn_group_banner 160 'conflicts.at:564' \
  "parse.error=verbose and consistent errors: lr.type=ielr parse.lac=full" "" 7
at_xfail=no
(
  $as_echo "160. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "a";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:564"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:564"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:564: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:564"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:564"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:564: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:564: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:564"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:564: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:564"
( $at_check_trace; bison -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:564"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:564: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:564"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/conflicts.at:564: \$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:564"
( $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:564"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$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
$as_echo "$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"; $as_echo "syntax error, unexpected \$end, 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_160
#AT_START_161
at_fn_group_banner 161 'conflicts.at:620' \
  "parse.error=verbose and consistent errors: " "    " 7
at_xfail=no
(
  $as_echo "161. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure



%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:620"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:620"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:620: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:620"
( $at_check_trace; bison -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:620"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:620: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:620"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:620: \$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:620"
( $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:620"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:620:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:620"
( $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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:620"
( $at_check_trace; sed >&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"; $as_echo "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:620"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:624' \
  "parse.error=verbose and consistent errors: %glr-parser" "" 7
at_xfail=no
(
  $as_echo "162. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:624: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:624"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:624"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:624: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:624"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:624"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:624: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:624"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:624"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:624: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:624"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:624"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:624: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:624"
( $at_check_trace; bison -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:624"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:624: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:624"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:624"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:624: \$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:624"
( $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:624"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:624:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:624"
( $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:624"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:624: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:624"
( $at_check_trace; sed >&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"; $as_echo "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:624"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:630' \
  "parse.error=verbose and consistent errors: lr.default-reduction=consistent" "" 7
at_xfail=no
(
  $as_echo "163. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:630: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:630"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:630"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:630: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:630"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:630"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:630: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:630"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:630"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:630: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:630"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:630"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:630: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:630"
( $at_check_trace; bison -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:630"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:630: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:630"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:630"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:630: \$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:630"
( $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:630"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:630:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:630"
( $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:630"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:630: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:630"
( $at_check_trace; sed >&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"; $as_echo "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:630"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:636' \
  "parse.error=verbose and consistent errors: lr.default-reduction=accepting" "" 7
at_xfail=no
(
  $as_echo "164. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:636: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:636"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:636: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:636"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:636: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:636"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:636: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:636"
( $at_check_trace; bison -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:636"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:636: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:636"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:636: \$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:636"
( $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:636"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:636:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:636"
( $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:636"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:636: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:636"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end, 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:636"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:640' \
  "parse.error=verbose and consistent errors: lr.type=canonical-lr" "" 7
at_xfail=no
(
  $as_echo "165. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:640"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:640"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:640: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:640"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:640: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:640"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:640: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:640"
( $at_check_trace; bison -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:640"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:640: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:640"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:640: \$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:640"
( $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:640"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:640:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:640"
( $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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:640"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end, 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:640"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:645' \
  "parse.error=verbose and consistent errors: parse.lac=full" "" 7
at_xfail=no
(
  $as_echo "166. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:645: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:645"
( $at_check_trace; bison -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:645"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:645: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:645"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:645: \$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:645"
( $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:645"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:645:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:645"
( $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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:645"
( $at_check_trace; sed >&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"; $as_echo "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: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_166
#AT_START_167
at_fn_group_banner 167 'conflicts.at:649' \
  "parse.error=verbose and consistent errors: parse.lac=full lr.default-reduction=accepting" "" 7
at_xfail=no
(
  $as_echo "167. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}



%code {
  #include <assert.h>
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *lvalp);
  #define USE(Var)
}

%define api.pure

%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' ;


%%

/*--------.
| yylex.  |
`--------*/

int yylex (YYSTYPE *lvalp)
{
  static char const *input = "aa";
  *lvalp = 1;
  return *input++;
}


/* A C error reporting function.  */
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
$as_echo "$at_srcdir/conflicts.at:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:649"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:649"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:649: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:649"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:649"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:649: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:649"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:649"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:649: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:649"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:649"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:649: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:649"
( $at_check_trace; bison -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:649"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/conflicts.at:649: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:649"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:649"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:649: \$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:649"
( $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:649"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/conflicts.at:649:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:649"
( $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:649"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:649"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected \$end
" | \
  $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:649"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'conflicts.at:674' \
  "LAC: %nonassoc requires splitting canonical LR states" "" 7
at_xfail=no
(
  $as_echo "168. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "aaa";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/conflicts.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:724: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:724"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:724: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:724"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:724: bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:724"
( $at_check_trace; bison -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"; $as_echo "input.y: warning: 2 shift/reduce conflicts [-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:724"
$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
$as_echo "$at_srcdir/conflicts.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror" "conflicts.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:724: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:724"
( $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:724"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error" "conflicts.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone -Werror" "conflicts.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror" "conflicts.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:724"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:728: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:728"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:728"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:728: \$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:728"
( $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:728"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:729:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:729"
( $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:729"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:729: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:729"
( $at_check_trace; sed >&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"; $as_echo "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:729"
$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
$as_echo "$at_srcdir/conflicts.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dlr.type=canonical-lr -Dparse.lac=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:734"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:734"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -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:734"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:734"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:734: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:734"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:734: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:734"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:734"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:734: bison -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:734"
( $at_check_trace; bison -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"; $as_echo "input.y: warning: 2 shift/reduce conflicts [-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:734"
$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
$as_echo "$at_srcdir/conflicts.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -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:734"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:734"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:734: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:734"
( $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:734"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -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:734"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:734"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:734"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:734"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:734: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:734"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:734"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:738: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:738"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:738"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:738: \$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:738"
( $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:738"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:739:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:739"
( $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:739"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:739: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:739"
( $at_check_trace; sed >&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"; $as_echo "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:739"
$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
$as_echo "$at_srcdir/conflicts.at:744: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:744"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:744: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" "conflicts.at:744"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:744"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:744: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:744"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:744: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:744"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:744: bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:744"
( $at_check_trace; bison -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"; $as_echo "input.y: warning: 2 shift/reduce conflicts [-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:744"
$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
$as_echo "$at_srcdir/conflicts.at:744: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror" "conflicts.at:744"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:744"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:744: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:744"
( $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:744"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:744: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error" "conflicts.at:744"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:744"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:744: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone -Werror" "conflicts.at:744"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:744: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror" "conflicts.at:744"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:744"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:748: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "conflicts.at:748"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/conflicts.at:748: \$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:748"
( $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:748"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:749:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:749"
( $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:749"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:749: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:749"
( $at_check_trace; sed >&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"; $as_echo "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:749"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'conflicts.at:759' \
  "Unresolved SR Conflicts" "                        " 7
at_xfail=no
(
  $as_echo "169. $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
$as_echo "$at_srcdir/conflicts.at:769: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:769"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:769"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:769: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:769"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:769"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:769: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:769"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:769"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:769: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:769"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:769"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:769: bison -fno-caret -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:769"
( $at_check_trace; bison -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"; $as_echo "input.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:769"
$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
$as_echo "$at_srcdir/conflicts.at:769: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Werror" "conflicts.at:769"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:769"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:769: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:769"
( $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:769"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:769: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=error" "conflicts.at:769"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:769"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:769: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Wnone -Werror" "conflicts.at:769"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:769"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:769: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=none -Werror" "conflicts.at:769"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:769"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/conflicts.at:774: cat input.output"
at_fn_check_prepare_trace "conflicts.at:774"
( $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"; $as_echo "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)
" | \
  $at_diff - "$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
  $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 'conflicts.at:866' \
  "Resolved SR Conflicts" "                          " 7
at_xfail=no
(
  $as_echo "170. $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
$as_echo "$at_srcdir/conflicts.at:877: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:877"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:877"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:877: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:877"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:877"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:877: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:877"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:877"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:877: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:877"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:877"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:877: bison -fno-caret -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:877"
( $at_check_trace; bison -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:877"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/conflicts.at:880: cat input.output"
at_fn_check_prepare_trace "conflicts.at:880"
( $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"; $as_echo "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:880"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:967' \
  "%precedence suffices" "                           " 7
at_xfail=no
(
  $as_echo "171. $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
$as_echo "$at_srcdir/conflicts.at:984: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:984"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:984"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:984: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:984"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:984"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:984: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:984"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:984"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:984: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:984"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:984"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:984: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:984"
( $at_check_trace; bison -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:984"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'conflicts.at:993' \
  "%precedence does not suffice" "                   " 7
at_xfail=no
(
  $as_echo "172. $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
$as_echo "$at_srcdir/conflicts.at:1011: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1011"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1011"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1011"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1011"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1011: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1011"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
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:1011"
$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
$as_echo "$at_srcdir/conflicts.at:1011: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "conflicts.at:1011"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:12.3-18: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1011"
( $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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1011"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "conflicts.at:1011"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1011"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1011: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "conflicts.at:1011"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1011"
$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 'conflicts.at:1044' \
  "Defaulted Conflicted Reduction" "                 " 7
at_xfail=no
(
  $as_echo "173. $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
$as_echo "$at_srcdir/conflicts.at:1055: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1055"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:1055"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1055"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1055"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1055: bison -fno-caret -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:1055"
( $at_check_trace; bison -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"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
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:1055"
$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
$as_echo "$at_srcdir/conflicts.at:1055: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Werror" "conflicts.at:1055"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:4.6-8: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1055"
( $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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=error" "conflicts.at:1055"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Wnone -Werror" "conflicts.at:1055"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1055: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=none -Werror" "conflicts.at:1055"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c --report=all input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1055"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/conflicts.at:1061: cat input.output"
at_fn_check_prepare_trace "conflicts.at:1061"
( $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"; $as_echo "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)


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:1061"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1163' \
  "%expect not enough" "                             " 7
at_xfail=no
(
  $as_echo "174. $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
$as_echo "$at_srcdir/conflicts.at:1172: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y" "conflicts.at:1172"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: error: shift/reduce conflicts: 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:1172"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1182' \
  "%expect right" "                                  " 7
at_xfail=no
(
  $as_echo "175. $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
$as_echo "$at_srcdir/conflicts.at:1191: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1191"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1191"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1191: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1191"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1191"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1191: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1191"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1191"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1191: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1191"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1191"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1191: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1191"
( $at_check_trace; bison -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:1191"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1199' \
  "%expect too much" "                               " 7
at_xfail=no
(
  $as_echo "176. $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
$as_echo "$at_srcdir/conflicts.at:1208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y" "conflicts.at:1208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: error: shift/reduce conflicts: 1 found, 2 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:1208"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1218' \
  "%expect with reduce conflicts" "                  " 7
at_xfail=no
(
  $as_echo "177. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%expect 0
%%
program: a 'a' | a a;
a: 'a';
_ATEOF



{ set +x
$as_echo "$at_srcdir/conflicts.at:1227: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y" "conflicts.at:1227"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: error: reduce/reduce conflicts: 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:1227"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1237' \
  "%prec with user string" "                         " 7
at_xfail=no
(
  $as_echo "178. $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
$as_echo "$at_srcdir/conflicts.at:1246: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1246"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1246"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1246: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1246"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1246"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1246: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1246"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1246"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1246: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1246"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1246"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1246: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1246"
( $at_check_trace; bison -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:1246"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1254' \
  "%no-default-prec without %prec" "                 " 7
at_xfail=no
(
  $as_echo "179. $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
$as_echo "$at_srcdir/conflicts.at:1270: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1270"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" "conflicts.at:1270"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1270"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1270"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1270: bison -fno-caret -Wall -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1270"
( $at_check_trace; bison -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"; $as_echo "input.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr]
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:1270"
$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
$as_echo "$at_srcdir/conflicts.at:1270: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror" "conflicts.at:1270"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1270"
( $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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error" "conflicts.at:1270"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror" "conflicts.at:1270"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1270"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1270: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror" "conflicts.at:1270"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1270"
$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_179
#AT_START_180
at_fn_group_banner 180 'conflicts.at:1282' \
  "%no-default-prec with %prec" "                    " 7
at_xfail=no
(
  $as_echo "180. $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
$as_echo "$at_srcdir/conflicts.at:1298: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1298"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1298"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1298: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1298"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1298"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1298: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1298"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1298"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1298: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1298"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1298"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1298: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1298"
( $at_check_trace; bison -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:1298"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1306' \
  "%default-prec" "                                  " 7
at_xfail=no
(
  $as_echo "181. $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
$as_echo "$at_srcdir/conflicts.at:1322: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1322"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1322"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1322: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1322"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1322"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1322: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1322"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1322"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1322: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1322"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1322"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1322: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1322"
( $at_check_trace; bison -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:1322"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1330' \
  "Unreachable States After Conflict Resolution" "   " 7
at_xfail=no
(
  $as_echo "182. $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
$as_echo "$at_srcdir/conflicts.at:1374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y" "conflicts.at:1374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1374"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1374"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1374: bison -fno-caret --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:1374"
( $at_check_trace; bison -fno-caret --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
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.13: 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:1374"
$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
$as_echo "$at_srcdir/conflicts.at:1374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y -Werror" "conflicts.at:1374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: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.13: 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1374"
( $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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y --warnings=error" "conflicts.at:1374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y -Wnone -Werror" "conflicts.at:1374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y --warnings=none -Werror" "conflicts.at:1374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1374"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/conflicts.at:1386: cat input.output"
at_fn_check_prepare_trace "conflicts.at:1386"
( $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"; $as_echo "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


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)


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:1386"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input-keep.y <<'_ATEOF'
%define lr.keep-unreachable-state
_ATEOF

{ set +x
$as_echo "$at_srcdir/conflicts.at:1525: cat input.y >> input-keep.y"
at_fn_check_prepare_trace "conflicts.at:1525"
( $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:1525"
$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
$as_echo "$at_srcdir/conflicts.at:1527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-keep.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input-keep.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input-keep.y" "conflicts.at:1527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1527"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1527"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1527: bison -fno-caret input-keep.y"
at_fn_check_prepare_trace "conflicts.at:1527"
( $at_check_trace; bison -fno-caret input-keep.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-keep.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input-keep.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
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:1527"
$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
$as_echo "$at_srcdir/conflicts.at:1527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y -Werror" "conflicts.at:1527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1527"
( $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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y --warnings=error" "conflicts.at:1527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y -Wnone -Werror" "conflicts.at:1527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-keep.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1527"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input-keep.y --warnings=none -Werror" "conflicts.at:1527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input-keep.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1527"
$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_182
#AT_START_183
at_fn_group_banner 183 'conflicts.at:1543' \
  "Solved conflicts report for multiple reductions in a state" "" 7
at_xfail=no
(
  $as_echo "183. $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: %prec 'a' ;
empty_b: %prec 'b' ;
empty_c1: %prec 'c' ;
empty_c2: %prec 'c' ;
empty_c3: %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
$as_echo "$at_srcdir/conflicts.at:1569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1569"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:1569"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1569: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1569"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1569"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1569: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1569"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1569"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1569: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1569"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1569"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1569: bison -fno-caret --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1569"
( $at_check_trace; bison -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:1569"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:1570: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1570"
( $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"; $as_echo "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:1570"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'conflicts.at:1623' \
  "%nonassoc error actions for multiple reductions in a state" "" 7
at_xfail=no
(
  $as_echo "184. $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
$as_echo "$at_srcdir/conflicts.at:1645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:1645"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1645"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1645"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1645"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1645: bison -fno-caret --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1645"
( $at_check_trace; bison -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:1645"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:1646: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1646"
( $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"; $as_echo "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').


State 1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1646"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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 'conflicts.at:1692' \
  "%expect-rr non GLR" "                             " 7
at_xfail=no
(
  $as_echo "185. $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
$as_echo "$at_srcdir/conflicts.at:1700: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot 1.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1700"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml 1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml 1.y" "conflicts.at:1700"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1700"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1700"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1700: bison -fno-caret 1.y"
at_fn_check_prepare_trace "conflicts.at:1700"
( $at_check_trace; bison -fno-caret 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1700"
$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
$as_echo "$at_srcdir/conflicts.at:1700: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y -Werror" "conflicts.at:1700"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1700"
( $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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y --warnings=error" "conflicts.at:1700"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y -Wnone -Werror" "conflicts.at:1700"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret 1.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1700"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1700: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 1.y --warnings=none -Werror" "conflicts.at:1700"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret 1.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1700"
$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
$as_echo "$at_srcdir/conflicts.at:1710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot 2.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1710"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml 2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml 2.y" "conflicts.at:1710"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1710"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1710"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1710: bison -fno-caret 2.y"
at_fn_check_prepare_trace "conflicts.at:1710"
( $at_check_trace; bison -fno-caret 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "2.y: warning: %expect-rr applies only to GLR parsers [-Wother]
2.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
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:1710"
$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
$as_echo "$at_srcdir/conflicts.at:1710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y -Werror" "conflicts.at:1710"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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:3.12-14: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1710"
( $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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y --warnings=error" "conflicts.at:1710"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y -Wnone -Werror" "conflicts.at:1710"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret 2.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1710"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1710: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret 2.y --warnings=none -Werror" "conflicts.at:1710"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret 2.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1710"
$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_185
#AT_START_186
at_fn_group_banner 186 'conflicts.at:1723' \
  "-W versus %expect and %expect-rr" "               " 7
at_xfail=no
(
  $as_echo "186. $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
$as_echo "$at_srcdir/conflicts.at:1746: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot sr-rr.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1746"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot 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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml sr-rr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml sr-rr.y" "conflicts.at:1746"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1746"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1746"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1746: bison -fno-caret sr-rr.y"
at_fn_check_prepare_trace "conflicts.at:1746"
( $at_check_trace; bison -fno-caret sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $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:1746"
$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
$as_echo "$at_srcdir/conflicts.at:1746: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y -Werror" "conflicts.at:1746"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1746"
( $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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y --warnings=error" "conflicts.at:1746"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y -Wnone -Werror" "conflicts.at:1746"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1746"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1746: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y --warnings=none -Werror" "conflicts.at:1746"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret sr-rr.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1746"
$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
$as_echo "$at_srcdir/conflicts.at:1750: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wno-conflicts-sr sr-rr.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1750"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" "conflicts.at:1750"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1750"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1750"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1750: bison -fno-caret -Wno-conflicts-sr sr-rr.y"
at_fn_check_prepare_trace "conflicts.at:1750"
( $at_check_trace; bison -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"; $as_echo "sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $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:1750"
$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
$as_echo "$at_srcdir/conflicts.at:1750: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y -Werror" "conflicts.at:1750"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1750"
( $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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error" "conflicts.at:1750"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone -Werror" "conflicts.at:1750"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1750"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1750: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror" "conflicts.at:1750"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1750"
$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
$as_echo "$at_srcdir/conflicts.at:1753: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wno-conflicts-rr sr-rr.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1753"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" "conflicts.at:1753"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1753"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1753"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1753: bison -fno-caret -Wno-conflicts-rr sr-rr.y"
at_fn_check_prepare_trace "conflicts.at:1753"
( $at_check_trace; bison -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"; $as_echo "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:1753"
$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
$as_echo "$at_srcdir/conflicts.at:1753: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y -Werror" "conflicts.at:1753"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1753"
( $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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error" "conflicts.at:1753"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone -Werror" "conflicts.at:1753"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1753"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1753: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror" "conflicts.at:1753"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1753"
$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
# combinaison 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
$as_echo "$at_srcdir/conflicts.at:1807: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wnone \$file"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1807"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1807"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1807: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wnone \$file"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wnone $file" "conflicts.at:1807"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1807"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1807: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1807"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1807"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1807: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1807"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1807"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1807: bison -fno-caret -Wnone \$file"
at_fn_check_prepare_dynamic "bison -fno-caret -Wnone $file" "conflicts.at:1807"
( $at_check_trace; bison -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:1807"
$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
$as_echo "$at_srcdir/conflicts.at:1808: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Werror \$file"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1808"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1808"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:1808: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Werror \$file"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Werror $file" "conflicts.at:1808"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1808"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1808: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1808"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1808"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:1808: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1808"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1808"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:1808: bison -fno-caret -Werror \$file"
at_fn_check_prepare_dynamic "bison -fno-caret -Werror $file" "conflicts.at:1808"
( $at_check_trace; bison -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:1808"
$at_failed && at_fn_log_failure
$at_traceon; }


      else
        {
          if test -z "$sr_exp_i" && test "$sr_count" -ne 0; then
            echo "warning: $sr_count shift/reduce conflicts"
          elif test "$sr_exp_i" -ne "$sr_count"; then
            echo "error: shift/reduce conflicts: $sr_count found, $sr_exp_i expected"
          fi
          if test -z "$rr_exp_i" && test "$rr_count" -ne 0; then
            echo "warning: $rr_count reduce/reduce conflicts"
          elif test "$rr_exp_i" -ne "$rr_count"; then
            echo "error: reduce/reduce conflicts: $rr_count found, $rr_exp_i expected"
          fi
        } | sed -e "s/^/$file: /" > experr

{ set +x
$as_echo "$at_srcdir/conflicts.at:1822: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wnone \$file"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wnone $file" "conflicts.at:1822"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1822"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/conflicts.at:1823: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror \$file"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Werror $file" "conflicts.at:1823"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1823"
$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_186
#AT_START_187
at_fn_group_banner 187 'synclines.at:173' \
  "Prologue syncline" "                              " 8
at_xfail=no
(
  $as_echo "187. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%{
#error "2"
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
$as_echo "$at_srcdir/synclines.at:173: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:173"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:173"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:173: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:173"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:173"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:173: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:173"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:173"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:173: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:173"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:173"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:173: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:173"
( $at_check_trace; bison -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:173"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:173: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:173"
( $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:173"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:173: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:173"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:173"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:173: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:173"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:173"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:173: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:173"
( $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:173"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:173: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:173"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:173"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:173: cat stdout"
at_fn_check_prepare_trace "synclines.at:173"
( $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"; $as_echo "input.y:2: #error \"2\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.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_187
#AT_START_188
at_fn_group_banner 188 'synclines.at:191' \
  "%union syncline" "                                " 8
at_xfail=no
(
  $as_echo "188. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%union {
#error "2"
  char dummy;
}
%{
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
$as_echo "$at_srcdir/synclines.at:191: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:191"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:191"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:191: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:191"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:191"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:191: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:191"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:191"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:191: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:191"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:191"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:191: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:191"
( $at_check_trace; bison -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:191"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:191: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:191"
( $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:191"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:191: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:191"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:191"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:191: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:191"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:191"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:191: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:191"
( $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:191"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:191: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:191"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:191"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:191: cat stdout"
at_fn_check_prepare_trace "synclines.at:191"
( $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"; $as_echo "input.y:2: #error \"2\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.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_188
#AT_START_189
at_fn_group_banner 189 'synclines.at:214' \
  "%union name syncline" "                           " 8
at_xfail=no
(
  $as_echo "189. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%union break
{
  char dummy;
}
%{
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
$as_echo "$at_srcdir/synclines.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:230"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:230"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:230: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:230"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:230"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:230: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:230"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:230"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:230: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:230"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:230"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:230: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:230"
( $at_check_trace; bison -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:230"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:231: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:231"
( $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:231"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:231: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:231"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:231"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:231: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:231"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:231"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:231: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:231"
( $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:231"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:231: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:231"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:231"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:232: grep '^input.y:1' stdout"
at_fn_check_prepare_trace "synclines.at:232"
( $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:232"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'synclines.at:241' \
  "Postprologue syncline" "                          " 8
at_xfail=no
(
  $as_echo "190. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%{
void yyerror (const char *msg);
int yylex (void);
%}
%union
{
  int ival;
}
%{
#error "10"
%}
%%
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
$as_echo "$at_srcdir/synclines.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:241"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:241"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:241: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:241"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:241: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:241"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:241: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:241"
( $at_check_trace; bison -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:241"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:241: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:241"
( $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:241"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:241: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:241"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:241"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:241: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:241"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:241"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:241: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:241"
( $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:241"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:241: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:241"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:241"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:241: cat stdout"
at_fn_check_prepare_trace "synclines.at:241"
( $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"; $as_echo "input.y:10: #error \"10\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:241"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'synclines.at:265' \
  "Action syncline" "                                " 8
at_xfail=no
(
  $as_echo "191. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%{
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
$as_echo "$at_srcdir/synclines.at:265: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:265"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:265"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:265: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:265"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:265"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:265: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:265"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:265"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:265: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:265"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:265"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:265: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:265"
( $at_check_trace; bison -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:265"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:265: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:265"
( $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:265"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:265: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:265"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:265"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:265: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:265"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:265"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:265: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:265"
( $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:265"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:265: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:265"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:265"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:265: cat stdout"
at_fn_check_prepare_trace "synclines.at:265"
( $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"; $as_echo "input.y:8: #error \"8\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.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_191
#AT_START_192
at_fn_group_banner 192 'synclines.at:284' \
  "Epilogue syncline" "                              " 8
at_xfail=no
(
  $as_echo "192. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%{
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
$as_echo "$at_srcdir/synclines.at:284: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:284"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:284"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:284: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:284"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:284"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:284: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:284"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:284"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:284: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:284"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:284"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:284: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:284"
( $at_check_trace; bison -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:284"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:284: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:284"
( $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:284"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:284: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:284"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:284"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:284: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:284"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:284"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:284: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:284"
( $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:284"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:284: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:284"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:284"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:284: cat stdout"
at_fn_check_prepare_trace "synclines.at:284"
( $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"; $as_echo "input.y:8: #error \"8\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'synclines.at:301' \
  "%code top syncline" "                             " 8
at_xfail=no
(
  $as_echo "193. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#error "2"
}
%{
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
$as_echo "$at_srcdir/synclines.at:301: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:301"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:301"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:301: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:301"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:301"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:301: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:301"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:301"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:301: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:301"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:301"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:301: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:301"
( $at_check_trace; bison -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:301"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
#error "1"
int i; /* avoids -pedantic warning about an empty translation unit. */
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:301: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:301"
( $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:301"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:301: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:301"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:301"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:301: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:301"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_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:301"
$at_failed && at_fn_log_failure
$at_traceon; }


# Then work for real.
{ set +x
$as_echo "$at_srcdir/synclines.at:301: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:301"
( $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:301"
$at_failed && at_fn_log_failure
$at_traceon; }


# Transform stderr into something like this:
#
#   input.y:4: #error "4"
#
# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
# It may also issue more context information:
#
#   input.y: In function 'yyparse':
#   input.y:8: #error "8"
# =>
#   input.y:4: #error "8"
#
# The message may include a caret-error (indented by GCC 4.8,
# not by clang 3.2):
#
#   input.y:1:2: error: #error "1"
#    #error "1"
#     ^
#
# Possibly distcc adds its bits.
#
#   distcc[33187] ERROR: compile (null) on localhost failed
#   syncline.c:1:2: error: #error "1"
#   distcc[33185] ERROR: compile syncline.c on localhost failed
#
# or even
#
#   distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host
#   distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead
#
# The compiler might end by the number of messages issued (Clang 3.2):
#
#    syncline.c:1:2: error: "1"
#    #error "1"
#     ^
#    1 error generated.
#
# When c++ is used to compiler C, we might have more messages (Clang 3.2):
#
#    clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
#
#
# xlc reports things like:
#
#    "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<".
#    "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers

{ set +x
$as_echo "$at_srcdir/synclines.at:301: \$PERL -p -0777 - stderr <<\\EOF
  # 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.
  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:301"
( $at_check_trace; $PERL -p -0777 - stderr <<\EOF
  # 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.
  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:301"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/synclines.at:301: cat stdout"
at_fn_check_prepare_trace "synclines.at:301"
( $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"; $as_echo "input.y:2: #error \"2\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:301"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'synclines.at:342' \
  "%no-lines: yacc.c" "                              " 8
at_xfail=no
(
  $as_echo "194. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "yacc.c" %defines
%{
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
$as_echo "$at_srcdir/synclines.at:342: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --no-lines -o input.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:342"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:342"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:342: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:342"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:342"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:342: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:342"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:342"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:342: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:342"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:342"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:342: bison -fno-caret --no-lines -o input.c -d input.y"
at_fn_check_prepare_trace "synclines.at:342"
( $at_check_trace; bison -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:342"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:342: grep '#line' *.c *.h"
at_fn_check_prepare_trace "synclines.at:342"
( $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: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_194
#AT_START_195
at_fn_group_banner 195 'synclines.at:343' \
  "%no-lines: glr.c" "                               " 8
at_xfail=no
(
  $as_echo "195. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "glr.c" %defines
%{
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
$as_echo "$at_srcdir/synclines.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --no-lines -o input.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:343"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:343: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:343"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:343: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:343"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:343: bison -fno-caret --no-lines -o input.c -d input.y"
at_fn_check_prepare_trace "synclines.at:343"
( $at_check_trace; bison -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:343"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:343: grep '#line' *.c *.h"
at_fn_check_prepare_trace "synclines.at:343"
( $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:343"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'synclines.at:344' \
  "%no-lines: lalr1.cc" "                            " 8
at_xfail=no
(
  $as_echo "196. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc" %defines
%{

int yylex (yy::parser::semantic_type *lvalp);
%}
%%
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
$as_echo "$at_srcdir/synclines.at:344: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:344"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:344"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:344: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:344"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:344"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:344: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:344"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:344"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:344: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:344"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:344"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:344: bison -fno-caret --no-lines -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:344"
( $at_check_trace; bison -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:344"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:344: grep '#line' *.cc *.hh"
at_fn_check_prepare_trace "synclines.at:344"
( $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:344"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'synclines.at:345' \
  "%no-lines: glr.cc" "                              " 8
at_xfail=no
(
  $as_echo "197. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "glr.cc" %defines
%{

int yylex (yy::parser::semantic_type *lvalp);
%}
%%
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
$as_echo "$at_srcdir/synclines.at:345: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --no-lines -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:345"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:345"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:345: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:345"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:345"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:345: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:345"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:345"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/synclines.at:345: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:345"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:345"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:345: bison -fno-caret --no-lines -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:345"
( $at_check_trace; bison -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:345"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:345: grep '#line' *.cc *.hh"
at_fn_check_prepare_trace "synclines.at:345"
( $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:345"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'headers.at:57' \
  "Invalid CPP guards:  --defines=input/input.h" "   " 9
at_xfail=no
(
  $as_echo "198. $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 ||
$as_echo 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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
#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
$as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:57"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:57"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:57: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:57"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:57"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:57: bison -fno-caret --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_trace "headers.at:57"
( $at_check_trace; bison -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:57"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:57: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:57"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/headers.at:57: \$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:57"
( $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: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_198
#AT_START_199
at_fn_group_banner 199 'headers.at:58' \
  "Invalid CPP guards:  --defines=9foo.h" "          " 9
at_xfail=no
(
  $as_echo "199. $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 ||
$as_echo 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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
#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
$as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:58"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:58"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:58: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:58"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:58"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:58: bison -fno-caret --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_trace "headers.at:58"
( $at_check_trace; bison -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:58"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:58: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:58"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/headers.at:58: \$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:58"
( $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: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_199
#AT_START_200
at_fn_group_banner 200 'headers.at:59' \
  "Invalid CPP guards: %glr-parser --defines=input/input.h" "" 9
at_xfail=no
(
  $as_echo "200. $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 ||
$as_echo 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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:59"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:59"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:59"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:59"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:59: bison -fno-caret --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_trace "headers.at:59"
( $at_check_trace; bison -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:59"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:59: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:59"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$at_srcdir/headers.at:59: \$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:59"
( $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: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_200
#AT_START_201
at_fn_group_banner 201 'headers.at:60' \
  "Invalid CPP guards: %glr-parser --defines=9foo.h" "" 9
at_xfail=no
(
  $as_echo "201. $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 ||
$as_echo 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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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
$as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:60"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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:60"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:60: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:60"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:60"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:60"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:60"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:60"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:60"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:60: bison -fno-caret --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_trace "headers.at:60"
( $at_check_trace; bison -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:60"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:60: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:60"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:60"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:60: \$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:60"
( $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:60"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'headers.at:69' \
  "export YYLTYPE" "                                 " 9
at_xfail=no
(
  $as_echo "202. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations

%name-prefix "my_"
%{
#include <stdio.h>
#include <stdlib.h>



/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:87"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines -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:87"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:87: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y" "headers.at:87"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --defines -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:87"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:87: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:87"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:87"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:87: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:87"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:87"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:87: bison -fno-caret --defines -o input.c input.y"
at_fn_check_prepare_trace "headers.at:87"
( $at_check_trace; bison -fno-caret --defines -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:87"
$at_failed && at_fn_log_failure
$at_traceon; }



# 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).
{ set +x
$as_echo "$at_srcdir/headers.at:101: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:101"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:101"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:101: \$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:101"
( $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:101"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:102: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:102"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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; }

{ set +x
$as_echo "$at_srcdir/headers.at:102: \$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:102"
( $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:102"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:103: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:103"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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; }

{ set +x
$as_echo "$at_srcdir/headers.at:103: \$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:103"
( $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:103"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:104:  \$PREPARSER ./caller"
at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:104"
( $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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:104: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "headers.at:104"
( $at_check_trace; 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: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_202
#AT_START_203
at_fn_group_banner 203 'headers.at:112' \
  "Several parsers" "                                " 9
at_xfail=no
(
  $as_echo "203. $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.  Check that headers are
# self-contained, and can be compiled by a C++ compiler.
# AT_TEST

cat >main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

// 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 "x6.hh"

#define RUN(S)                                  \
  do {                                          \
    int res = S;                                \
    if (res)                                    \
      std::cerr << #S": " << res << std::endl;  \
  } 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());
//  x6_::parser p6;
//  RUN(p6.parse());
  return 0;
}
_ATEOF
# main.cc


cat >x1.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x1_}

%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

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"); }
;

%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:205: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x1.c x1.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:205"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:205"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:205: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y" "headers.at:205"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:205"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:205: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:205"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:205"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:205: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:205"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:205"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:205: bison -fno-caret -d -o x1.c x1.y"
at_fn_check_prepare_trace "headers.at:205"
( $at_check_trace; bison -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:205"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:205: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:205"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:205"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:205: \$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:205"
( $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:205"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:205: echo \"x1\" >>expout"
at_fn_check_prepare_trace "headers.at:205"
( $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:205"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x2_}
%locations %debug
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

#if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, X2_LTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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"); }
;

%%


# if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, X2_LTYPE const * const yylocp)
{
  unsigned 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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x2.c x2.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:206"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y" "headers.at:206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:206"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:206: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:206"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:206"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:206: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:206"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:206"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:206: bison -fno-caret -d -o x2.c x2.y"
at_fn_check_prepare_trace "headers.at:206"
( $at_check_trace; bison -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:206"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:206: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:206"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:206"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:206: \$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:206"
( $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:206"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:206: echo \"x2\" >>expout"
at_fn_check_prepare_trace "headers.at:206"
( $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:206"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x3.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x3_}
%glr-parser
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

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"); }
;

%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:207: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x3.c x3.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:207"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:207"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:207: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y" "headers.at:207"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:207"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:207: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:207"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:207"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:207: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:207"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:207"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:207: bison -fno-caret -d -o x3.c x3.y"
at_fn_check_prepare_trace "headers.at:207"
( $at_check_trace; bison -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:207"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:207: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:207"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:207"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:207: \$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:207"
( $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:207"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:207: echo \"x3\" >>expout"
at_fn_check_prepare_trace "headers.at:207"
( $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:207"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x4.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x4_}
%locations %debug %glr-parser
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

#if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, X4_LTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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"); }
;

%%


# if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, X4_LTYPE const * const yylocp)
{
  unsigned 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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x4.c x4.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:208: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y" "headers.at:208"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:208: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:208"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:208: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:208"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:208: bison -fno-caret -d -o x4.c x4.y"
at_fn_check_prepare_trace "headers.at:208"
( $at_check_trace; bison -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:208"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:208: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:208"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:208: \$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:208"
( $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:208"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:208: echo \"x4\" >>expout"
at_fn_check_prepare_trace "headers.at:208"
( $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:208"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x5.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x5_}
%locations %debug %language "c++"
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>

  static int x5_lex (x5_::parser::semantic_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"); }
;

%%
/* A C++ error reporting function.  */
void
x5_::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <assert.h>
static
int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp)
{
  static char const input[] = "x5";
  static size_t toknum = 0;
  int res;
  (void) lvalp;(void) llocp;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:209: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x5.cc x5.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:209"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:209: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y" "headers.at:209"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:209"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:209: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:209"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:209: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:209"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:209: bison -fno-caret -d -o x5.cc x5.y"
at_fn_check_prepare_trace "headers.at:209"
( $at_check_trace; bison -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:209"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/headers.at:209: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:209"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:209: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o x5.o x5.cc "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o x5.o x5.cc " "headers.at:209"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:209: echo \"x5\" >>expout"
at_fn_check_prepare_trace "headers.at:209"
( $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:209"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x6.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x6_}
%define api.pure
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

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"); }
;

%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x6.c x6.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y" "headers.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:210"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:210: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:210"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:210: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:210"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:210: bison -fno-caret -d -o x6.c x6.y"
at_fn_check_prepare_trace "headers.at:210"
( $at_check_trace; bison -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:210"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:210: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:210"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:210"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:210: \$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:210"
( $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:210"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:210: echo \"x6\" >>expout"
at_fn_check_prepare_trace "headers.at:210"
( $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:210"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x7.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x7_}
%define api.push-pull both
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

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"); }
;

%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x7.c x7.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y" "headers.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:211: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:211"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:211: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:211"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:211: bison -fno-caret -d -o x7.c x7.y"
at_fn_check_prepare_trace "headers.at:211"
( $at_check_trace; bison -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:211"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:211: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:211"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:211: \$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:211"
( $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:211"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:211: echo \"x7\" >>expout"
at_fn_check_prepare_trace "headers.at:211"
( $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:211"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >x8.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define api.prefix {x8_}
%define api.pure %define api.push-pull both
%error-verbose
%union
{
  int integer;
}
%{
#include <stdio.h>
  #include <stdio.h>

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"); }
;

%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/headers.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -o x8.c x8.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:212"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:212"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:212: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y" "headers.at:212"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:212"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:212: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:212"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:212"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/headers.at:212: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:212"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:212"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/headers.at:212: bison -fno-caret -d -o x8.c x8.y"
at_fn_check_prepare_trace "headers.at:212"
( $at_check_trace; bison -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:212"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/headers.at:212: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:212"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:212"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:212: \$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:212"
( $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:212"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:212: echo \"x8\" >>expout"
at_fn_check_prepare_trace "headers.at:212"
( $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:212"
$at_failed && at_fn_log_failure
$at_traceon; }




#AT_TEST([x5], [%locations %language "c++" %glr-parser])

# Check there is no 'yy' left.
# C++ output relies on namespaces and still uses yy a lot.
#
# Check there is no 'YY' left.
# Ignore comments, YYChar (template parameter), YYPUSH_MORE(_DEFINED)?
# (constant definition), YY_\w+_INCLUDED (header guards).
# YYDEBUG (not renamed) can be read, but not changed.
{ set +x
$as_echo "$at_srcdir/headers.at:222: \$PERL -n -0777 -e '
  s{/\\*.*?\\*/}{}gs;
  s{//.*}{}g;
  s{\\b(YYChar
      |YYPUSH_MORE(?:_DEFINED)?
      |YYUSE
      |YY_ATTRIBUTE(?:_PURE|_UNUSED)?
      |YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
      |YY_INITIAL_VALUE
      |YY_\\w+_INCLUDED
      |YY_NULLPTR
      |(defined|if)\\ YYDEBUG
      )\\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:222"
( $at_check_trace; $PERL -n -0777 -e '
  s{/\*.*?\*/}{}gs;
  s{//.*}{}g;
  s{\b(YYChar
      |YYPUSH_MORE(?:_DEFINED)?
      |YYUSE
      |YY_ATTRIBUTE(?:_PURE|_UNUSED)?
      |YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
      |YY_INITIAL_VALUE
      |YY_\w+_INCLUDED
      |YY_NULLPTR
      |(defined|if)\ YYDEBUG
      )\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:222"
$at_failed && at_fn_log_failure
$at_traceon; }


# 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 *.hh
do
  # No shell expansion with AT_DATA.
  cat >$h.cc <<EOF
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "$h"
#include "$h"
EOF

{ set +x
$as_echo "$at_srcdir/headers.at:258: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:258"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:258: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o \$h.o \$h.cc "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o $h.o $h.cc " "headers.at:258"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

done

# 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

{ set +x
$as_echo "$at_srcdir/headers.at:262: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "headers.at:262"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:262"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:262: \$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:262"
( $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:262"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/headers.at:262: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:262"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:262"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:262: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx-only.o cxx-only.cc "
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx-only.o cxx-only.cc " "headers.at:262"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -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:262"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:262: \$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:262"
( $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
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_skip $at_status "$at_srcdir/headers.at:262"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:262:  \$PREPARSER ./c-and-cxx"
at_fn_check_prepare_dynamic " $PREPARSER ./c-and-cxx" "headers.at:262"
( $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:262"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:262: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "headers.at:262"
( $at_check_trace; 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:262"
$at_failed && at_fn_log_failure
$at_traceon; }





{ set +x
$as_echo "$at_srcdir/headers.at:264: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "headers.at:264"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:264: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=\$CC_IS_CXX main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS" "headers.at:264"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-8].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:264"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:265:  \$PREPARSER ./parser"
at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:265"
( $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:265"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:265: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "headers.at:265"
( $at_check_trace; 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: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_203
#AT_START_204
at_fn_group_banner 204 'actions.at:24' \
  "Mid-rule actions" "                               " 10
at_xfail=no
(
  $as_echo "204. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Bison once forgot the mid-rule actions.  It was because the action
# was attached to the host rule (the one with the mid-rule action),
# instead of being attached to the empty rule dedicated to this
# action.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define parse.error verbose
%debug
%code {
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "123456789";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:59"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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
$as_echo "$at_srcdir/actions.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:59"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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
$as_echo "$at_srcdir/actions.at:59: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:59: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:59"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:59: bison -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:59"
( $at_check_trace; bison -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; }


{ set +x
$as_echo "$at_srcdir/actions.at:60: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:60"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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
$as_echo "$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
$as_echo "$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"; $as_echo "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
$as_echo "$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_204
#AT_START_205
at_fn_group_banner 205 'actions.at:71' \
  "Implicitly empty rule" "                          " 10
at_xfail=no
(
  $as_echo "205. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >1.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%%
exp: a b;
a: /* empty. */ {};
// A mid-rule 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
$as_echo "$at_srcdir/actions.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret -Wempty-rule 1.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y" "actions.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:81: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:81"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:81: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:81"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:81: bison -fno-caret -fcaret -Wempty-rule 1.y"
at_fn_check_prepare_trace "actions.at:81"
( $at_check_trace; bison -fno-caret -fcaret -Wempty-rule 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
 a: /* empty. */ {};
                 ^^
" | \
  $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:81"
$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
$as_echo "$at_srcdir/actions.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Werror" "actions.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:81"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
 a: /* empty. */ {};
                 ^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:81: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:81"
( $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:81"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=error" "actions.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:81"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Wnone -Werror" "actions.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:81"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:81: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror" "actions.at:81"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:81"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

cat >2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%%
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
$as_echo "$at_srcdir/actions.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret 2.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:95"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret 2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret 2.y" "actions.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:95"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:95: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:95"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:95"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:95: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:95"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:95"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:95: bison -fno-caret -fcaret 2.y"
at_fn_check_prepare_trace "actions.at:95"
( $at_check_trace; bison -fno-caret -fcaret 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
 a: /* empty. */ {};
                 ^^
2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule]
 c: /* empty. */ {};
                 ^^
" | \
  $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:95"
$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
$as_echo "$at_srcdir/actions.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Werror" "actions.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:95"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
 a: /* empty. */ {};
                 ^^
2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule]
 c: /* empty. */ {};
                 ^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:95: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:95"
( $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:95"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=error" "actions.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:95"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Wnone -Werror" "actions.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:95"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:95: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=none -Werror" "actions.at:95"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret 2.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:95"
$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
$as_echo "$at_srcdir/actions.at:104: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret -Wno-empty-rule 2.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:104"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:104: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y" "actions.at:104"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:104: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:104"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:104: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:104"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:104"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:104: bison -fno-caret -fcaret -Wno-empty-rule 2.y"
at_fn_check_prepare_trace "actions.at:104"
( $at_check_trace; bison -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: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_205
#AT_START_206
at_fn_group_banner 206 'actions.at:112' \
  "Invalid uses of %empty" "                         " 10
at_xfail=no
(
  $as_echo "206. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >one.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%%
exp:
  %empty {} %empty
;
_ATEOF




{ set +x
$as_echo "$at_srcdir/actions.at:121: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret one.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret one.y" "actions.at:121"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret one.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "one.y:11.13-18: error: only one %empty allowed per rule
   %empty {} %empty
             ^^^^^^
one.y:11.3-8: previous declaration
   %empty {} %empty
   ^^^^^^
" | \
  $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:121"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >two.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%%
exp:
  'a' %empty    {}
| %empty 'a'    {}
| %empty {}     {}
;
_ATEOF




{ set +x
$as_echo "$at_srcdir/actions.at:139: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret two.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret two.y" "actions.at:139"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret two.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "two.y:11.7-12: error: %empty on non-empty rule
   'a' %empty    {}
       ^^^^^^
two.y:12.3-8: error: %empty on non-empty rule
 | %empty 'a'    {}
   ^^^^^^
two.y:13.3-8: error: %empty on non-empty rule
 | %empty {}     {}
   ^^^^^^
" | \
  $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: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_206
#AT_START_207
at_fn_group_banner 207 'actions.at:157' \
  "Valid uses of %empty" "                           " 10
at_xfail=no
(
  $as_echo "207. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%debug
%code
{
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: %empty {}
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:176"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:176"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:176: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:176"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:176"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:176: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:176"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:176"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:176: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:176"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:176"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:176: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:176"
( $at_check_trace; bison -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:176"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:176: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:176"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:176"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:176: \$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:176"
( $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:176"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:177:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:177"
( $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:177"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:177: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:177"
( $at_check_trace; 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:177"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:241' \
  "Initial location: yacc.c " "                      " 10
at_xfail=no
(
  $as_echo "208. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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
$as_echo "$at_srcdir/actions.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:241"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:241: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:241"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:241: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:241"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:241: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:241"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:241: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:241"
( $at_check_trace; bison -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:241"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:241: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:241"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:241: \$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:241"
( $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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:241:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:241"
( $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:241"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:241: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:241"
( $at_check_trace; sed >&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"; $as_echo "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:241"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:242' \
  "Initial location: yacc.c api.pure=full" "         " 10
at_xfail=no
(
  $as_echo "209. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:242"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:242"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:242: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:242"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:242: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:242"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:242: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:242"
( $at_check_trace; bison -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:242"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:242: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:242"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:242: \$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:242"
( $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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:242:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:242"
( $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:242"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:242: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:242"
( $at_check_trace; sed >&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"; $as_echo "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:242"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:243' \
  "Initial location: yacc.c api.pure %parse-param { int x }" "" 10
at_xfail=no
(
  $as_echo "210. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (YYLTYPE const * const llocp, int x, const char *msg)
{
  YYUSE(x);
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:243: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:243"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:243: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:243"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:243: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:243"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:243: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:243"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:243: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:243"
( $at_check_trace; bison -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:243"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:243: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:243"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:243: \$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:243"
( $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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:243:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:243"
( $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:243"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:243: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:243"
( $at_check_trace; sed >&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"; $as_echo "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:243"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:244' \
  "Initial location: yacc.c api.push-pull=both" "    " 10
at_xfail=no
(
  $as_echo "211. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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
$as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:244"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:244: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:244"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:244: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:244"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:244: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:244"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:244: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:244"
( $at_check_trace; bison -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:244"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:244: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:244"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:244: \$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:244"
( $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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:244:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:244"
( $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:244"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:244: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:244"
( $at_check_trace; sed >&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"; $as_echo "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:244"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:245' \
  "Initial location: yacc.c api.push-pull=both api.pure=full" "" 10
at_xfail=no
(
  $as_echo "212. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:245: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:245"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:245"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:245: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:245"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:245: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:245"
( $at_check_trace; bison -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:245"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:245: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:245"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:245: \$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:245"
( $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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:245:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:245"
( $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:245"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:245: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:245"
( $at_check_trace; sed >&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"; $as_echo "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:245"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:246' \
  "Initial location: glr.c " "                       " 10
at_xfail=no
(
  $as_echo "213. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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
$as_echo "$at_srcdir/actions.at:246: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:246"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:246: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:246"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:246: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:246"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:246: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:246"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:246: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:246"
( $at_check_trace; bison -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:246"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:246: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:246"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:246: \$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:246"
( $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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:246:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:246"
( $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:246"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:246: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:246"
( $at_check_trace; sed >&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"; $as_echo "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:246"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:247' \
  "Initial location: glr.c api.pure" "               " 10
at_xfail=no
(
  $as_echo "214. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:247"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:247: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:247"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:247: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:247"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:247: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:247"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:247: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:247"
( $at_check_trace; bison -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:247"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:247: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:247"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:247: \$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:247"
( $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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:247:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:247"
( $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:247"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:247"
( $at_check_trace; sed >&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"; $as_echo "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:247"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:248' \
  "Initial location: lalr1.cc " "                    " 10
at_xfail=no
(
  $as_echo "215. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%debug
%skeleton "lalr1.cc"


%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */

static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: { std::cerr << @$ << std::endl; }
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}

int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:248: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:248"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:248: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:248"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:248: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:248"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:248: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:248"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:248: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:248"
( $at_check_trace; bison -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:248"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:248: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:248"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:248: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:248"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:248:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:248"
( $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:248"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:248: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:248"
( $at_check_trace; sed >&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"; $as_echo "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: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_215
#AT_START_216
at_fn_group_banner 216 'actions.at:249' \
  "Initial location: glr.cc " "                      " 10
at_xfail=no
(
  $as_echo "216. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%debug
%skeleton "glr.cc"


%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */

static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: { std::cerr << @$ << std::endl; }
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}

int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:249"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:249: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:249"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:249: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:249"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:249: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:249"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:249: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:249"
( $at_check_trace; bison -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:249"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:249: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:249"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:249: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:249"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:249:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:249"
( $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:249"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:249: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:249"
( $at_check_trace; sed >&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"; $as_echo "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:249"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:258' \
  "Initial location: yacc.c api.pure=full" "         " 10
at_xfail=no
(
  $as_echo "217. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:258"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:258"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:258: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:258"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:258: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:258"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:258: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:258"
( $at_check_trace; bison -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:258"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:258: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:258"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:258: \$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:258"
( $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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:258:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:258"
( $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:258"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:258: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:258"
( $at_check_trace; sed >&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"; $as_echo "
: 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:258"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:269' \
  "Initial location: yacc.c api.pure=full" "         " 10
at_xfail=no
(
  $as_echo "218. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  YYUSE(lvalp);
  YYUSE(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
$as_echo "$at_srcdir/actions.at:269: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:269"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:269: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:269"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:269: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:269"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:269: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:269"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:269: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:269"
( $at_check_trace; bison -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:269"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:269: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:269"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:269: \$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:269"
( $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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:269:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:269"
( $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:269"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:269: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:269"
( $at_check_trace; sed >&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"; $as_echo "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:269"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:352' \
  "Location print: yacc.c " "                        " 10
at_xfail=no
(
  $as_echo "219. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%debug
%skeleton "yacc.c"


%code
{
#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:352"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:352"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:352: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:352"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:352: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:352"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:352: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:352"
( $at_check_trace; bison -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:352"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:352: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:352"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:352: \$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:352"
( $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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:352:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:352"
( $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"; $as_echo "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:352"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:352: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:352"
( $at_check_trace; 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:352"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:353' \
  "Location print: glr.c " "                         " 10
at_xfail=no
(
  $as_echo "220. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%debug
%skeleton "glr.c"


%code
{
#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:353: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:353"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:353: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:353"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:353: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:353"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:353: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:353"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:353: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:353"
( $at_check_trace; bison -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:353"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:353: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:353"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:353: \$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:353"
( $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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:353:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:353"
( $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"; $as_echo "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:353"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:353"
( $at_check_trace; 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:353"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:354' \
  "Location print: lalr1.cc " "                      " 10
at_xfail=no
(
  $as_echo "221. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%debug
%skeleton "lalr1.cc"


%code
{

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  (void) lvalp;(void) llocp;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:354: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:354"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:354: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:354"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:354: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:354"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:354: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:354"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:354: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:354"
( $at_check_trace; bison -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:354"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:354: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:354"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:354: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:354"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:354:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:354"
( $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"; $as_echo "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:354"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:354"
( $at_check_trace; 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:354"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:355' \
  "Location print: glr.cc " "                        " 10
at_xfail=no
(
  $as_echo "222. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%debug
%skeleton "glr.cc"


%code
{

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  (void) lvalp;(void) llocp;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:355"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:355: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:355"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:355: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:355"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:355: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:355"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:355: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:355"
( $at_check_trace; bison -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:355"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:355: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:355"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:355: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:355"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:355:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:355"
( $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"; $as_echo "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:355"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:355"
( $at_check_trace; 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:355"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:365' \
  "Exotic Dollars" "                                 " 10
at_xfail=no
(
  $as_echo "223. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define parse.error verbose
%debug
%code {
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:409: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:409"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:409"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:409: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:409"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:409"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:409: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:409"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:409"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:409: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:409"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:409"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:409: bison -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:409"
( $at_check_trace; bison -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:409"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:410: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:410"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:410"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:410: \$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:410"
( $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:410"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:411:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:411"
( $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"; $as_echo "15
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:411"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:411"
( $at_check_trace; 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:411"
$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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:439"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:439: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:439"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:439: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:439"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:439: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:439"
( $at_check_trace; bison -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:439"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:439: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:439"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:439"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:439: \$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:439"
( $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:439"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:440:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:440"
( $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"; $as_echo "6
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:440: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:440"
( $at_check_trace; 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: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_223
#AT_START_224
at_fn_group_banner 224 'actions.at:850' \
  "Printers and Destructors" "                       " 10
at_xfail=no
(
  $as_echo "224. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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

/* Display the symbol type Symbol.  */
#define V(Symbol, Value, Location, Sep) \
   fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
}

%define parse.error verbose
%debug
%verbose
%locations



%code {

static int yylex (void);
#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
}



/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%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 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:
  /* Nothing. */
    {
      $$ = 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");
    }
;

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

static
int yylex (void)
{
  static unsigned int counter = 0;

  unsigned int c = (yylval) = counter++;
  /* 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;
  assert (c <= strlen (source));
  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
$as_echo "$at_srcdir/actions.at:850: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:850"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:850: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:850"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:850: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:850"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:850: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:850"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:850: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:850"
( $at_check_trace; bison -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:850"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:850: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:850"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:850: \$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:850"
( $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:850"
$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
$as_echo "$at_srcdir/actions.at:850:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:850"
( $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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:850: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:850"
( $at_check_trace; sed >&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"; $as_echo "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:850"
$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
$as_echo "$at_srcdir/actions.at:850:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:850"
( $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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:850: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:850"
( $at_check_trace; sed >&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"; $as_echo "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:850"
$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
$as_echo "$at_srcdir/actions.at:850:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:850"
( $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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:850: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:850"
( $at_check_trace; sed >&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"; $as_echo "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:850"
$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
$as_echo "$at_srcdir/actions.at:850:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:850"
( $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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:850: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:850"
( $at_check_trace; sed >&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"; $as_echo "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:850"
$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
$as_echo "$at_srcdir/actions.at:850:  \$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:850"
( $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:850"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:850: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:850"
( $at_check_trace; sed >&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"; $as_echo "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:850"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'actions.at:851' \
  "Printers and Destructors with union" "            " 10
at_xfail=no
(
  $as_echo "225. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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

/* Display the symbol type Symbol.  */
#define V(Symbol, Value, Location, Sep) \
   fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
}

%type <ival> '(' 'x' 'y' ')' ';' thing line input END

/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%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 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:
  /* Nothing. */
    {
      $$ = 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");
    }
;

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

static
int yylex (void)
{
  static unsigned int counter = 0;

  unsigned int c = (yylval).ival = counter++;
  /* 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;
  assert (c <= strlen (source));
  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
$as_echo "$at_srcdir/actions.at:851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:851: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:851"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:851: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:851"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:851: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:851"
( $at_check_trace; bison -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:851"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:851: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:851"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:851: \$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:851"
( $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:851"
$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
$as_echo "$at_srcdir/actions.at:851:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:851"
( $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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:851"
( $at_check_trace; sed >&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"; $as_echo "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:851"
$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
$as_echo "$at_srcdir/actions.at:851:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:851"
( $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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:851"
( $at_check_trace; sed >&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"; $as_echo "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:851"
$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
$as_echo "$at_srcdir/actions.at:851:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:851"
( $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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:851"
( $at_check_trace; sed >&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"; $as_echo "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:851"
$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
$as_echo "$at_srcdir/actions.at:851:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:851"
( $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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:851"
( $at_check_trace; sed >&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"; $as_echo "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:851"
$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
$as_echo "$at_srcdir/actions.at:851:  \$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:851"
( $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:851"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:851"
( $at_check_trace; sed >&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"; $as_echo "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:851"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'actions.at:853' \
  "Printers and Destructors: %defines lalr1.cc" "    " 10
at_xfail=no
(
  $as_echo "226. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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

/* Display the symbol type Symbol.  */
#define V(Symbol, Value, Location, Sep) \
   fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
}

%define parse.error verbose
%debug
%verbose
%locations
%defines %skeleton "lalr1.cc"

%define global_tokens_and_yystype
%code {
typedef yy::location YYLTYPE;
static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);

}



/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    debug_stream () << $$;;
  }
  input line thing 'x' 'y'

%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 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:
  /* Nothing. */
    {
      $$ = 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");
    }
;

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 << std::endl;
}

static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static unsigned int counter = 0;

  unsigned int c = (*lvalp) = counter++;
  /* 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;
  assert (c <= strlen (source));
  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
$as_echo "$at_srcdir/actions.at:853: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:853"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:853: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:853"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:853: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:853"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:853: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:853"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:853: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:853"
( $at_check_trace; bison -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:853"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:853: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:853"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:853: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:853"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:853"
$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
$as_echo "$at_srcdir/actions.at:853:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:853"
( $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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:853: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:853"
( $at_check_trace; sed >&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"; $as_echo "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:853"
$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
$as_echo "$at_srcdir/actions.at:853:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:853"
( $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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:853: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:853"
( $at_check_trace; sed >&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"; $as_echo "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:853"
$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
$as_echo "$at_srcdir/actions.at:853:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:853"
( $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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:853: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:853"
( $at_check_trace; sed >&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"; $as_echo "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:853"
$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
$as_echo "$at_srcdir/actions.at:853:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:853"
( $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:853"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:853: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:853"
( $at_check_trace; sed >&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"; $as_echo "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:853"
$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_226
#AT_START_227
at_fn_group_banner 227 'actions.at:854' \
  "Printers and Destructors with union: %defines lalr1.cc" "" 10
at_xfail=no
(
  $as_echo "227. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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

/* Display the symbol type Symbol.  */
#define V(Symbol, Value, Location, Sep) \
   fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
}

%define parse.error verbose
%debug
%verbose
%locations
%defines %skeleton "lalr1.cc"
%union
{
  int ival;
}
%define global_tokens_and_yystype
%code provides {
typedef yy::location YYLTYPE;
static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);

}

%type <ival> '(' 'x' 'y' ')' ';' thing line input END

/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    debug_stream () << $$;;
  }
  input line thing 'x' 'y'

%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 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:
  /* Nothing. */
    {
      $$ = 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");
    }
;

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 << std::endl;
}

static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static unsigned int counter = 0;

  unsigned int c = (*lvalp).ival = counter++;
  /* 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;
  assert (c <= strlen (source));
  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
$as_echo "$at_srcdir/actions.at:854: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:854"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:854: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:854"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:854: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:854"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:854: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:854"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:854: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:854"
( $at_check_trace; bison -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:854"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:854: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:854"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:854: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:854"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:854"
$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
$as_echo "$at_srcdir/actions.at:854:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:854"
( $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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:854"
( $at_check_trace; sed >&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"; $as_echo "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:854"
$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
$as_echo "$at_srcdir/actions.at:854:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:854"
( $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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:854"
( $at_check_trace; sed >&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"; $as_echo "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:854"
$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
$as_echo "$at_srcdir/actions.at:854:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:854"
( $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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:854"
( $at_check_trace; sed >&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"; $as_echo "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:854"
$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
$as_echo "$at_srcdir/actions.at:854:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:854"
( $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:854"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:854"
( $at_check_trace; sed >&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"; $as_echo "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:854"
$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_227
#AT_START_228
at_fn_group_banner 228 'actions.at:856' \
  "Printers and Destructors: %glr-parser" "          " 10
at_xfail=no
(
  $as_echo "228. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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

/* Display the symbol type Symbol.  */
#define V(Symbol, Value, Location, Sep) \
   fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
}



/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%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 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:
  /* Nothing. */
    {
      $$ = 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");
    }
;

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

static
int yylex (void)
{
  static unsigned int counter = 0;

  unsigned int c = (yylval) = counter++;
  /* 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;
  assert (c <= strlen (source));
  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
$as_echo "$at_srcdir/actions.at:856: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:856"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:856: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:856"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:856: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:856"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:856: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:856"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:856: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:856"
( $at_check_trace; bison -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:856"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:856: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:856"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:856: \$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:856"
( $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:856"
$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
$as_echo "$at_srcdir/actions.at:856:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:856"
( $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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:856"
( $at_check_trace; sed >&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"; $as_echo "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:856"
$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
$as_echo "$at_srcdir/actions.at:856:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:856"
( $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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:856"
( $at_check_trace; sed >&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"; $as_echo "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:856"
$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
$as_echo "$at_srcdir/actions.at:856:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:856"
( $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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:856"
( $at_check_trace; sed >&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"; $as_echo "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:856"
$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
$as_echo "$at_srcdir/actions.at:856:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:856"
( $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:856"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:856"
( $at_check_trace; sed >&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"; $as_echo "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:856"
$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_228
#AT_START_229
at_fn_group_banner 229 'actions.at:857' \
  "Printers and Destructors with union: %glr-parser" "" 10
at_xfail=no
(
  $as_echo "229. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%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

/* Display the symbol type Symbol.  */
#define V(Symbol, Value, Location, Sep) \
   fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location))
}

%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 unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
}

%type <ival> '(' 'x' 'y' ')' ';' thing line input END

/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%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 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:
  /* Nothing. */
    {
      $$ = 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");
    }
;

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

static
int yylex (void)
{
  static unsigned int counter = 0;

  unsigned int c = (yylval).ival = counter++;
  /* 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;
  assert (c <= strlen (source));
  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
$as_echo "$at_srcdir/actions.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:857: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:857"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:857: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:857"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:857: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:857"
( $at_check_trace; bison -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:857"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:857: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:857"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:857: \$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:857"
( $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:857"
$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
$as_echo "$at_srcdir/actions.at:857:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:857"
( $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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:857"
( $at_check_trace; sed >&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"; $as_echo "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:857"
$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
$as_echo "$at_srcdir/actions.at:857:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:857"
( $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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:857"
( $at_check_trace; sed >&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"; $as_echo "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:857"
$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
$as_echo "$at_srcdir/actions.at:857:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:857"
( $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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:857"
( $at_check_trace; sed >&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"; $as_echo "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:857"
$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
$as_echo "$at_srcdir/actions.at:857:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:857"
( $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:857"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:857"
( $at_check_trace; sed >&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"; $as_echo "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:857"
$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_229
#AT_START_230
at_fn_group_banner 230 'actions.at:868' \
  "Default tagless %printer and %destructor" "       " 10
at_xfail=no
(
  $as_echo "230. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define parse.error verbose
%debug
%locations

%code {
static int yylex (void);
#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
# define USE(SYM)
}

%printer {
  fprintf (yyoutput, "<*> printer should not be called.\n");
} <*>

%printer {
  fprintf (yyoutput, "<> printer for '%c' @ %d", $$, @$.first_column);
} <>
%destructor {
  fprintf (stdout, "<> destructor for '%c' @ %d.\n", $$, @$.first_column);
} <>

%printer {
  fprintf (yyoutput, "'b'/'c' printer for '%c' @ %d", $$, @$.first_column);
} 'b' 'c'
%destructor {
  fprintf (stdout, "'b'/'c' destructor for '%c' @ %d.\n", $$, @$.first_column);
} 'b' 'c'

%destructor {
  fprintf (yyoutput, "<*> destructor should not be called.\n");
} <*>

%%

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:913: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:913"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:913"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:913: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:913"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:913"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:913: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:913"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:913"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:913: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:913"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:913"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:913: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:913"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:913"
$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
$as_echo "$at_srcdir/actions.at:913: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:913"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:913"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:913: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:913"
( $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:913"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:913: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:913"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:913"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:913: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:913"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:913"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:913: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:913"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:913"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:917: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:917"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:917"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:917: \$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:917"
( $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:917"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:918:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:918"
( $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"; $as_echo "<> 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:918"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:918: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:918"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 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
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
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
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
Reading a token: Now at end of input.
1.5: syntax error, unexpected \$end, 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 (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:918"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'actions.at:961' \
  "Default tagged and per-type %printer and %destructor" "" 10
at_xfail=no
(
  $as_echo "231. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define parse.error verbose
%debug

%{
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
%}

%printer {
  fprintf (yyoutput, "<> printer should not be called.\n");
} <>

%union { int field0; int field1; int field2; }
%type <field0> start 'a' 'g'
%type <field1> 'e'
%type <field2> 'f'
%printer {
  fprintf (yyoutput, "<*>/<field2>/e printer");
} <*> 'e' <field2>
%destructor {
  fprintf (stdout, "<*>/<field2>/e destructor.\n");
} <*> 'e' <field2>

%type <field1> 'b'
%printer { fprintf (yyoutput, "<field1> printer"); } <field1>
%destructor { fprintf (stdout, "<field1> destructor.\n"); } <field1>

%type <field0> 'c'
%printer { fprintf (yyoutput, "'c' printer"); } 'c'
%destructor { fprintf (stdout, "'c' destructor.\n"); } 'c'

%type <field1> 'd'
%printer { fprintf (yyoutput, "'d' printer"); } 'd'
%destructor { fprintf (stdout, "'d' destructor.\n"); } 'd'

%destructor {
  fprintf (yyoutput, "<> destructor should not be called.\n");
} <>

%%

start:
  'a' 'b' 'c' 'd' 'e' 'f' 'g'
    {
      USE(($1, $2, $3, $4, $5, $6, $7));
      $$ = 'S';
    }
  ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "abcdef";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1020"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1020"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1020: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1020"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1020: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1020"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1020: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1020"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1020"
$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
$as_echo "$at_srcdir/actions.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1020"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1020: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1020"
( $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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1020"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1020"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1020: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1020"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1020"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1024: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1024"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1024"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1024: \$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:1024"
( $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:1024"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1025:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1025"
( $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"; $as_echo "<*>/<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:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1025: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1025"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token 'a' (<*>/<field2>/e printer)
Shifting token 'a' (<*>/<field2>/e printer)
Entering state 1
Reading a token: Next token is token 'b' (<field1> printer)
Shifting token 'b' (<field1> printer)
Entering state 3
Reading a token: Next token is token 'c' ('c' printer)
Shifting token 'c' ('c' printer)
Entering state 5
Reading a token: Next token is token 'd' ('d' printer)
Shifting token 'd' ('d' printer)
Entering state 6
Reading a token: Next token is token 'e' (<*>/<field2>/e printer)
Shifting token 'e' (<*>/<field2>/e printer)
Entering state 7
Reading a token: Next token is token 'f' (<*>/<field2>/e printer)
Shifting token 'f' (<*>/<field2>/e printer)
Entering state 8
Reading a token: Now at end of input.
syntax error, unexpected \$end, 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 ()
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:1025"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'actions.at:1080' \
  "Default %printer and %destructor for user-defined end token" "" 10
at_xfail=no
(
  $as_echo "232. $at_setup_line: testing $at_desc ..."
  $at_traceon


# AT_TEST(TYPED)
# --------------





cat >input0.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define parse.error verbose
%debug
%locations

%code {
#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
}

%destructor {
  fprintf (yyoutput, "<*> destructor should not be called.\n");
} <*>

%token END 0
%printer {
  fprintf (yyoutput, "<> for '%c' @ %d", $$, @$.first_column);
} <>
%destructor {
  fprintf (stdout, "<> for '%c' @ %d.\n", $$, @$.first_column);
} <>

%printer {
  fprintf (yyoutput, "<*> printer should not be called.\n");
} <*>




%%

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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input0.c input0.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y" "actions.at:1177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1177: bison -fno-caret -o input0.c input0.y"
at_fn_check_prepare_trace "actions.at:1177"
( $at_check_trace; bison -fno-caret -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1177"
$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
$as_echo "$at_srcdir/actions.at:1177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Werror" "actions.at:1177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1177: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1177"
( $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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=error" "actions.at:1177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Wnone -Werror" "actions.at:1177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=none -Werror" "actions.at:1177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input0.c input0.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/actions.at:1177: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1177"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1177: \$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:1177"
( $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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1177:  \$PREPARSER ./input0 --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input0 --debug" "actions.at:1177"
( $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"; $as_echo "<> for 'E' @ 1.
<> for 'S' @ 1.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1177: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1177"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 49):
-> \$\$ = nterm start (1.1: <> for 'S' @ 1)
Stack now 0
Entering state 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
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:1177"
$at_failed && at_fn_log_failure
$at_traceon; }









cat >input1.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%define parse.error verbose
%debug
%locations

%code {
#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
}

%destructor {
  fprintf (yyoutput, "<> destructor should not be called.\n");
} <>

%token END 0
%printer {
  fprintf (yyoutput, "<*> for '%c' @ %d", $$, @$.first_column);
} <*>
%destructor {
  fprintf (stdout, "<*> for '%c' @ %d.\n", $$, @$.first_column);
} <*>

%printer {
  fprintf (yyoutput, "<> printer should not be called.\n");
} <>

%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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input1.c input1.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1178: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1178"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1178: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1178"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1178: bison -fno-caret -o input1.c input1.y"
at_fn_check_prepare_trace "actions.at:1178"
( $at_check_trace; bison -fno-caret -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1178"
$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
$as_echo "$at_srcdir/actions.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Werror" "actions.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1178: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1178"
( $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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=error" "actions.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Wnone -Werror" "actions.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=none -Werror" "actions.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input1.c input1.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/actions.at:1178: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1178"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1178: \$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:1178"
( $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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1178:  \$PREPARSER ./input1 --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input1 --debug" "actions.at:1178"
( $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"; $as_echo "<*> for 'E' @ 1.
<*> for 'S' @ 1.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1178"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1178: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1178"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 49):
-> \$\$ = nterm start (1.1: <*> for 'S' @ 1)
Stack now 0
Entering state 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
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:1178"
$at_failed && at_fn_log_failure
$at_traceon; }









  set +x
  $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 'actions.at:1190' \
  "Default %printer and %destructor are not for error or \$undefined" "" 10
at_xfail=no
(
  $as_echo "233. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
%}

%printer {
  fprintf (yyoutput, "'%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "abd";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  yylval = res;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1235"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1235"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1235: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1235"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1235: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1235"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1235: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1235"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1235"
$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
$as_echo "$at_srcdir/actions.at:1235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1235"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1235: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1235"
( $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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1235"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1235"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1235: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1235"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1235"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1239: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1239"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1239"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1239: \$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:1239"
( $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:1239"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1240:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1240"
( $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:1240"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1240: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1240"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token 'a' ('a')
Shifting token 'a' ('a')
Entering state 1
Reading a token: Next token is token 'b' ('b')
syntax error
Shifting token error ()
Entering state 3
Next token is token 'b' ('b')
Shifting token 'b' ('b')
Entering state 5
Reading a token: Next token is token \$undefined ()
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
Next token is token \$undefined ()
Error: discarding token \$undefined ()
Error: popping token error ()
Stack now 0 1
Shifting token error ()
Entering state 3
Reading a token: Now at end of input.
Cleanup: discarding lookahead token \$end ()
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:1240"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:1283' \
  "Default %printer and %destructor are not for \$accept" "" 10
at_xfail=no
(
  $as_echo "234. $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 {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug /* So that %printer is actually compiled.  */

%{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
%}

%printer {
  char chr = $$;
  fprintf (yyoutput, "'%c'", chr);
} <> <*>
%destructor {
  char chr = $$;
  fprintf (stderr, "DESTROY '%c'\n", chr);
} <> <*>

%union { char chr; }
%type <chr> start

%%

start: { USE($$); } ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1333: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1333"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1333: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1333"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1333: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1333"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1333: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1333"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1333: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1333"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:1333"
$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
$as_echo "$at_srcdir/actions.at:1333: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1333"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1333: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1333"
( $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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1333: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1333"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1333: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1333"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1333: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1333"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1333"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1337: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1337"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1337"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1337: \$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:1337"
( $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:1337"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'actions.at:1347' \
  "Default %printer and %destructor for mid-rule values" "" 10
at_xfail=no
(
  $as_echo "235. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug /* So that %printer is actually compiled.  */

%{
#include <stdio.h>

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 (yyoutput, "%d", @$); } <>
%destructor { fprintf (stderr, "DESTROY %d\n", @$); } <>
%printer { fprintf (yyoutput, "<*> printer should not be called"); } <*>
%destructor { fprintf (yyoutput, "<*> destructor should not be called"); } <*>

%%

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1385"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1385"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1385: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1385"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:24.70-72: warning: useless %destructor for type <*> [-Wother]
input.y:24.70-72: 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:1385"
$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
$as_echo "$at_srcdir/actions.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "actions.at:1385"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:24.70-72: warning: useless %destructor for type <*> [-Wother]
input.y:24.70-72: 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: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1385: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1385"
( $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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "actions.at:1385"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "actions.at:1385"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1385"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1385: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "actions.at:1385"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1385"
$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
$as_echo "$at_srcdir/actions.at:1392: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1392"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1392: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1392"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1392: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1392"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1392: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1392"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1392: bison -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1392"
( $at_check_trace; bison -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"; $as_echo "input.y:24.70-72: warning: useless %destructor for type <*> [-Wother]
 %printer { fprintf (yyoutput, \"<*> printer should not be called\"); } <*>
                                                                      ^^^
input.y:24.70-72: warning: useless %printer for type <*> [-Wother]
 %printer { fprintf (yyoutput, \"<*> printer should not be called\"); } <*>
                                                                      ^^^
input.y:33.3-23: warning: unset value: \$\$ [-Wother]
   {           @\$ = 4; } // Only used.
   ^^^^^^^^^^^^^^^^^^^^^
input.y:32.3-23: warning: unused value: \$3 [-Wother]
   { 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:1392"
$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
$as_echo "$at_srcdir/actions.at:1392: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" "actions.at:1392"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:24.70-72: warning: useless %destructor for type <*> [-Wother]
 %printer { fprintf (yyoutput, "<*> printer should not be called"); } <*>
                                                                      ^^^
input.y:24.70-72: warning: useless %printer for type <*> [-Wother]
 %printer { fprintf (yyoutput, "<*> printer should not be called"); } <*>
                                                                      ^^^
input.y:33.3-23: warning: unset value: $$ [-Wother]
   {           @$ = 4; } // Only used.
   ^^^^^^^^^^^^^^^^^^^^^
input.y:32.3-23: warning: unused value: $3 [-Wother]
   { USE ($$); @$ = 3; } // Only set.
   ^^^^^^^^^^^^^^^^^^^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/actions.at:1392: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1392"
( $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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/actions.at:1392: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" "actions.at:1392"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/actions.at:1392: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" "actions.at:1392"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1392: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" "actions.at:1392"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1392"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/actions.at:1407: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1407"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1407"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1407: \$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:1407"
( $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:1407"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1408:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1408"
( $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:1408"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.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 >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 30):
-> \$\$ = nterm \$@1 (: )
Stack now 0
Entering state 2
Reducing stack by rule 2 (line 31):
-> \$\$ = nterm @2 (: 2)
Stack now 0 2
Entering state 4
Reducing stack by rule 3 (line 32):
-> \$\$ = nterm @3 (: 3)
Stack now 0 2 4
Entering state 5
Reducing stack by rule 4 (line 33):
-> \$\$ = nterm @4 (: 4)
Stack now 0 2 4 5
Entering state 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 (: )
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:1408"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:1492' \
  "@\$ in %initial-action implies %locations" "       " 10
at_xfail=no
(
  $as_echo "236. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
#include <stdio.h>

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.  */
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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1492"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1492"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1492: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1492"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1492: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1492"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1492: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1492"
( $at_check_trace; bison -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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1492: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1492"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1492: \$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:1492"
( $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:1492"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'actions.at:1493' \
  "@\$ in %destructor implies %locations" "           " 10
at_xfail=no
(
  $as_echo "237. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
#include <stdio.h>

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.  */
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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1493: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1493"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1493: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1493"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1493: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1493"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1493: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1493"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1493: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1493"
( $at_check_trace; bison -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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1493: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1493"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1493: \$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:1493"
( $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:1493"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'actions.at:1494' \
  "@\$ in %printer implies %locations" "              " 10
at_xfail=no
(
  $as_echo "238. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
#include <stdio.h>

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.  */
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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1494"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1494: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1494"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1494: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1494"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1494: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1494"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1494: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1494"
( $at_check_trace; bison -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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1494: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1494"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1494: \$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:1494"
( $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:1494"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'actions.at:1606' \
  "Qualified \$\$ in actions: yacc.c" "                " 10
at_xfail=no
(
  $as_echo "239. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "yacc.c"
%debug
%code requires
{
  typedef struct sem_type
  {
    int ival;
    float fval;
  } sem_type;

# define YYSTYPE sem_type


# include <stdio.h>
  static void
  report (FILE* yyo, int ival, float fval)
  {
    fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
  }

}

%code
{
  #include <stdio.h>

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.2;
}

%%
float: UNTYPED INT
{
  $$       = $<fval>1 + $<fval>2;
  $<ival>$ = $<ival>1 + $2;
};
%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1606: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1606"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1606: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1606"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1606: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1606"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1606: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1606"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1606: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1606"
( $at_check_trace; bison -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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:1606: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1606"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1606: \$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:1606"
( $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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1606:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1606"
( $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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_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:1606"
$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
$as_echo "$at_srcdir/actions.at:1606: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1606"
( $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"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Reading a token: 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:1606"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'actions.at:1607' \
  "Qualified \$\$ in actions: glr.c" "                 " 10
at_xfail=no
(
  $as_echo "240. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "glr.c"
%debug
%code requires
{
  typedef struct sem_type
  {
    int ival;
    float fval;
  } sem_type;

# define YYSTYPE sem_type


# include <stdio.h>
  static void
  report (FILE* yyo, int ival, float fval)
  {
    fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
  }

}

%code
{
  #include <stdio.h>

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.2;
}

%%
float: UNTYPED INT
{
  $$       = $<fval>1 + $<fval>2;
  $<ival>$ = $<ival>1 + $2;
};
%%


/* A C error reporting function.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).ival = toknum * 10; (yylval).fval = toknum / 10.0;;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1607"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1607"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1607: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1607"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1607: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1607"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1607: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1607"
( $at_check_trace; bison -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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/actions.at:1607: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1607"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1607: \$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:1607"
( $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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1607:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1607"
( $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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_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:1607"
$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
$as_echo "$at_srcdir/actions.at:1607: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1607"
( $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"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Reading a token: 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:1607"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'actions.at:1608' \
  "Qualified \$\$ in actions: lalr1.cc" "              " 10
at_xfail=no
(
  $as_echo "241. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%debug
%code requires
{
  typedef struct sem_type
  {
    int ival;
    float fval;
  } sem_type;

# define YYSTYPE sem_type


# include <iostream>
  namespace
  {
    void
    report (std::ostream& yyo, int ival, float fval)
    {
      yyo << "ival: " << ival << ", fval: " <<  fval;
    }
  }

}

%code
{

  static int yylex (yy::parser::semantic_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.2;
}

%%
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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static int const input[] = {yy::parser::token::UNTYPED,
                                 yy::parser::token::INT,
                                  EOF};
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/actions.at:1608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1608"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1608"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1608: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1608"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1608: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1608"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1608: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1608"
( $at_check_trace; bison -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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:1608: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1608"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1608: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1608"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1608:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1608"
( $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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_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:1608"
$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
$as_echo "$at_srcdir/actions.at:1608: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1608"
( $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"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Reading a token: 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:1608"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'actions.at:1609' \
  "Qualified \$\$ in actions: glr.cc" "                " 10
at_xfail=no
(
  $as_echo "242. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "glr.cc"
%debug
%code requires
{
  typedef struct sem_type
  {
    int ival;
    float fval;
  } sem_type;

# define YYSTYPE sem_type


# include <iostream>
  namespace
  {
    void
    report (std::ostream& yyo, int ival, float fval)
    {
      yyo << "ival: " << ival << ", fval: " <<  fval;
    }
  }

}

%code
{

  static int yylex (yy::parser::semantic_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.2;
}

%%
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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static int const input[] = {yy::parser::token::UNTYPED,
                                 yy::parser::token::INT,
                                  EOF};
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).ival = toknum * 10; (*lvalp).fval = toknum / 10.0;;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/actions.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1609"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1609"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1609: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1609"
( $at_check_trace; bison -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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/actions.at:1609: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:1609"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1609: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1609"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1609:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1609"
( $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:1609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1609"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_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:1609"
$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
$as_echo "$at_srcdir/actions.at:1609: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1609"
( $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"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Reading a token: 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: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_242
#AT_START_243
at_fn_group_banner 243 'actions.at:1617' \
  "Destroying lookahead assigned by semantic action" "" 10
at_xfail=no
(
  $as_echo "243. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%code {
  #include <assert.h>
  #include <stdio.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/actions.at:1659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1659"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1659"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1659"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1659"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1659: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1659"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1659"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1659: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1659"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1659"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1659: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1659"
( $at_check_trace; bison -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:1659"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1660: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1660"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1660"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1660: \$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:1660"
( $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:1660"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1661:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1661"
( $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:1661"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1661: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1661"
( $at_check_trace; sed >&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"; $as_echo "'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:1661"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'actions.at:1672' \
  "YYBACKUP" "                                       " 10
at_xfail=no
(
  $as_echo "244. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%error-verbose
%debug
%pure-parser
%code {
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>

  #include <stdio.h>

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.  */
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 size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  *lvalp = (toknum + 1) * 10;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/actions.at:1707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1707"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:1707"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1707: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1707"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:1707"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1707: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1707"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1707"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/actions.at:1707: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1707"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:1707"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1707: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1707"
( $at_check_trace; bison -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:1707"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1708: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "actions.at:1708"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:1708"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1708: \$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:1708"
( $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:1708"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1709:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1709"
( $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"; $as_echo "a: 123
a: 456
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1709"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1709: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1709"
( $at_check_trace; 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:1709"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'types.at:25' \
  "%union vs. api.value.type" "                      " 11
at_xfail=no
(
  $as_echo "245. $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
$as_echo "$at_srcdir/types.at:34: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:34"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-22: 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_245
#AT_START_246
at_fn_group_banner 246 'types.at:44' \
  "%yacc vs. api.value.type=union" "                 " 11
at_xfail=no
(
  $as_echo "246. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%yacc
%define api.value.type union
%%
exp: %empty;
_ATEOF



{ set +x
$as_echo "$at_srcdir/types.at:53: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:53"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-22: 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_246
#AT_START_247
at_fn_group_banner 247 'types.at:128' \
  "yacc.c api.value.type={double}" "                 " 11
at_xfail=no
(
  $as_echo "247. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_247
#AT_START_248
at_fn_group_banner 248 'types.at:128' \
  "yacc.c api.value.type={double} %defines" "        " 11
at_xfail=no
(
  $as_echo "248. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
           %define api.value.type {double} %defines


%%

start: '1' '2' { printf ("%2.1f\n", $1 + $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_248
#AT_START_249
at_fn_group_banner 249 'types.at:128' \
  "yacc.c api.value.type={variant}" "                " 11
at_xfail=no
(
  $as_echo "249. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_249
#AT_START_250
at_fn_group_banner 250 'types.at:128' \
  "yacc.c api.value.type={variant} %defines" "       " 11
at_xfail=no
(
  $as_echo "250. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
           %define api.value.type {variant} %defines
%code requires { typedef double variant; }

%%

start: '1' '2' { printf ("%2.1f\n", $1 + $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_250
#AT_START_251
at_fn_group_banner 251 'types.at:128' \
  "yacc.c api.value.type={struct foo}" "             " 11
at_xfail=no
(
  $as_echo "251. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).ival = (res - '0') * 10;
           (yylval).fval = (res - '0') / 10.f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_251
#AT_START_252
at_fn_group_banner 252 'types.at:128' \
  "yacc.c api.value.type={struct foo} %defines" "    " 11
at_xfail=no
(
  $as_echo "252. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
           %define api.value.type {struct foo} %defines
%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).ival = (res - '0') * 10;
           (yylval).fval = (res - '0') / 10.f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_252
#AT_START_253
at_fn_group_banner 253 'types.at:128' \
  "yacc.c api.value.type={struct bar}" "             " 11
at_xfail=no
(
  $as_echo "253. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).up = (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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_253
#AT_START_254
at_fn_group_banner 254 'types.at:128' \
  "yacc.c api.value.type={struct bar} %defines" "    " 11
at_xfail=no
(
  $as_echo "254. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
           %define api.value.type {struct bar} %defines
%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).up = (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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_254
#AT_START_255
at_fn_group_banner 255 'types.at:128' \
  "yacc.c api.value.type={union foo}" "              " 11
at_xfail=no
(
  $as_echo "255. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (yylval).ival = 10;
           else
             (yylval).fval = .2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_255
#AT_START_256
at_fn_group_banner 256 'types.at:128' \
  "yacc.c api.value.type={union foo} %defines" "     " 11
at_xfail=no
(
  $as_echo "256. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
           %define api.value.type {union foo} %defines
%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (yylval).ival = 10;
           else
             (yylval).fval = .2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_256
#AT_START_257
at_fn_group_banner 257 'types.at:128' \
  "yacc.c %union { float fval; int ival; };" "       " 11
at_xfail=no
(
  $as_echo "257. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_257
#AT_START_258
at_fn_group_banner 258 'types.at:128' \
  "yacc.c %union { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "258. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
             %union { float fval; int ival; }; %defines
%token <ival> '1';
             %token <fval> '2';

%%

start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_258
#AT_START_259
at_fn_group_banner 259 'types.at:128' \
  "yacc.c %union foo { float fval; int ival; };" "   " 11
at_xfail=no
(
  $as_echo "259. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_259
#AT_START_260
at_fn_group_banner 260 'types.at:128' \
  "yacc.c %union foo { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "260. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
             %union foo { float fval; int ival; }; %defines
%token <ival> '1';
             %token <fval> '2';

%%

start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_260
#AT_START_261
at_fn_group_banner 261 'types.at:128' \
  "yacc.c api.value.union.name=foo; %union { float fval; int ival; };" "" 11
at_xfail=no
(
  $as_echo "261. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_261
#AT_START_262
at_fn_group_banner 262 'types.at:128' \
  "yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "262. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
             %define api.value.union.name foo; %union { float fval; int ival; }; %defines
%token <ival> '1';
             %token <fval> '2';

%%

start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_262
#AT_START_263
at_fn_group_banner 263 'types.at:128' \
  "yacc.c api.value.type=union" "                    " 11
at_xfail=no
(
  $as_echo "263. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_263
#AT_START_264
at_fn_group_banner 264 'types.at:128' \
  "yacc.c api.value.type=union %defines" "           " 11
at_xfail=no
(
  $as_echo "264. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "yacc.c"
           %define api.value.type union %defines
%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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_264
#AT_START_265
at_fn_group_banner 265 'types.at:128' \
  "glr.c api.value.type={double}" "                  " 11
at_xfail=no
(
  $as_echo "265. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_265
#AT_START_266
at_fn_group_banner 266 'types.at:128' \
  "glr.c api.value.type={double} %defines" "         " 11
at_xfail=no
(
  $as_echo "266. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
           %define api.value.type {double} %defines


%%

start: '1' '2' { printf ("%2.1f\n", $1 + $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_266
#AT_START_267
at_fn_group_banner 267 'types.at:128' \
  "glr.c api.value.type={variant}" "                 " 11
at_xfail=no
(
  $as_echo "267. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_267
#AT_START_268
at_fn_group_banner 268 'types.at:128' \
  "glr.c api.value.type={variant} %defines" "        " 11
at_xfail=no
(
  $as_echo "268. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
           %define api.value.type {variant} %defines
%code requires { typedef double variant; }

%%

start: '1' '2' { printf ("%2.1f\n", $1 + $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval) = (res - '0') / 10.0;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_268
#AT_START_269
at_fn_group_banner 269 'types.at:128' \
  "glr.c api.value.type={struct foo}" "              " 11
at_xfail=no
(
  $as_echo "269. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).ival = (res - '0') * 10;
           (yylval).fval = (res - '0') / 10.f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_269
#AT_START_270
at_fn_group_banner 270 'types.at:128' \
  "glr.c api.value.type={struct foo} %defines" "     " 11
at_xfail=no
(
  $as_echo "270. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
           %define api.value.type {struct foo} %defines
%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).ival = (res - '0') * 10;
           (yylval).fval = (res - '0') / 10.f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_270
#AT_START_271
at_fn_group_banner 271 'types.at:128' \
  "glr.c api.value.type={struct bar}" "              " 11
at_xfail=no
(
  $as_echo "271. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).up = (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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_271
#AT_START_272
at_fn_group_banner 272 'types.at:128' \
  "glr.c api.value.type={struct bar} %defines" "     " 11
at_xfail=no
(
  $as_echo "272. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
           %define api.value.type {struct bar} %defines
%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (yylval).up = (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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_272
#AT_START_273
at_fn_group_banner 273 'types.at:128' \
  "glr.c api.value.type={union foo}" "               " 11
at_xfail=no
(
  $as_echo "273. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (yylval).ival = 10;
           else
             (yylval).fval = .2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_273
#AT_START_274
at_fn_group_banner 274 'types.at:128' \
  "glr.c api.value.type={union foo} %defines" "      " 11
at_xfail=no
(
  $as_echo "274. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
           %define api.value.type {union foo} %defines
%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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (yylval).ival = 10;
           else
             (yylval).fval = .2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_274
#AT_START_275
at_fn_group_banner 275 'types.at:128' \
  "glr.c %union { float fval; int ival; };" "        " 11
at_xfail=no
(
  $as_echo "275. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_275
#AT_START_276
at_fn_group_banner 276 'types.at:128' \
  "glr.c %union { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "276. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
             %union { float fval; int ival; }; %defines
%token <ival> '1';
             %token <fval> '2';

%%

start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_276
#AT_START_277
at_fn_group_banner 277 'types.at:128' \
  "glr.c %union foo { float fval; int ival; };" "    " 11
at_xfail=no
(
  $as_echo "277. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_277
#AT_START_278
at_fn_group_banner 278 'types.at:128' \
  "glr.c %union foo { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "278. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
             %union foo { float fval; int ival; }; %defines
%token <ival> '1';
             %token <fval> '2';

%%

start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_278
#AT_START_279
at_fn_group_banner 279 'types.at:128' \
  "glr.c api.value.union.name=foo; %union { float fval; int ival; };" "" 11
at_xfail=no
(
  $as_echo "279. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_279
#AT_START_280
at_fn_group_banner 280 'types.at:128' \
  "glr.c api.value.union.name=foo; %union { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "280. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
             %define api.value.union.name foo; %union { float fval; int ival; }; %defines
%token <ival> '1';
             %token <fval> '2';

%%

start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (yylval).ival = 10;
             else
               (yylval).fval = 0.2f;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_280
#AT_START_281
at_fn_group_banner 281 'types.at:128' \
  "glr.c api.value.type=union" "                     " 11
at_xfail=no
(
  $as_echo "281. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_281
#AT_START_282
at_fn_group_banner 282 'types.at:128' \
  "glr.c api.value.type=union %defines" "            " 11
at_xfail=no
(
  $as_echo "282. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
}

%skeleton "glr.c"
           %define api.value.type union %defines
%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.  */
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 size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "types.at:128"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$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:128"
( $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_282
#AT_START_283
at_fn_group_banner 283 'types.at:128' \
  "lalr1.cc api.value.type={double}" "               " 11
at_xfail=no
(
  $as_echo "283. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_283
#AT_START_284
at_fn_group_banner 284 'types.at:128' \
  "lalr1.cc api.value.type={double} %defines" "      " 11
at_xfail=no
(
  $as_echo "284. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type {double} %defines


%%

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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_284
#AT_START_285
at_fn_group_banner 285 'types.at:128' \
  "lalr1.cc api.value.type={variant}" "              " 11
at_xfail=no
(
  $as_echo "285. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_285
#AT_START_286
at_fn_group_banner 286 'types.at:128' \
  "lalr1.cc api.value.type={variant} %defines" "     " 11
at_xfail=no
(
  $as_echo "286. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type {variant} %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_286
#AT_START_287
at_fn_group_banner 287 'types.at:128' \
  "lalr1.cc api.value.type={struct foo}" "           " 11
at_xfail=no
(
  $as_echo "287. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).ival = (res - '0') * 10;
           (*lvalp).fval = (res - '0') / 10.f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_287
#AT_START_288
at_fn_group_banner 288 'types.at:128' \
  "lalr1.cc api.value.type={struct foo} %defines" "  " 11
at_xfail=no
(
  $as_echo "288. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type {struct foo} %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).ival = (res - '0') * 10;
           (*lvalp).fval = (res - '0') / 10.f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_288
#AT_START_289
at_fn_group_banner 289 'types.at:128' \
  "lalr1.cc api.value.type={struct bar}" "           " 11
at_xfail=no
(
  $as_echo "289. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).up = (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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_289
#AT_START_290
at_fn_group_banner 290 'types.at:128' \
  "lalr1.cc api.value.type={struct bar} %defines" "  " 11
at_xfail=no
(
  $as_echo "290. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type {struct bar} %defines
%code requires
           {
             struct u
             {
               int ival;
             };
             struct bar
             {
               struct u *up;
             };
           }
           %token <up->ival> '1' '2'
           %printer { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).up = (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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_290
#AT_START_291
at_fn_group_banner 291 'types.at:128' \
  "lalr1.cc api.value.type={union foo}" "            " 11
at_xfail=no
(
  $as_echo "291. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (*lvalp).ival = 10;
           else
             (*lvalp).fval = .2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_291
#AT_START_292
at_fn_group_banner 292 'types.at:128' \
  "lalr1.cc api.value.type={union foo} %defines" "   " 11
at_xfail=no
(
  $as_echo "292. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type {union foo} %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (*lvalp).ival = 10;
           else
             (*lvalp).fval = .2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_292
#AT_START_293
at_fn_group_banner 293 'types.at:128' \
  "lalr1.cc %union { float fval; int ival; };" "     " 11
at_xfail=no
(
  $as_echo "293. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (*lvalp).ival = 10;
             else
               (*lvalp).fval = 0.2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_293
#AT_START_294
at_fn_group_banner 294 'types.at:128' \
  "lalr1.cc %union { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "294. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
             %union { float fval; int ival; }; %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (*lvalp).ival = 10;
             else
               (*lvalp).fval = 0.2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_294
#AT_START_295
at_fn_group_banner 295 'types.at:128' \
  "lalr1.cc api.value.type=union" "                  " 11
at_xfail=no
(
  $as_echo "295. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type union
%token <int> ONE 101;
           %token <float> TWO 102 THREE 103;
           %printer { yyoutput << $$; } <int>
           %printer { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static int const input[] = { 101, 102, 103, EOF };
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_295
#AT_START_296
at_fn_group_banner 296 'types.at:128' \
  "lalr1.cc api.value.type=union %defines" "         " 11
at_xfail=no
(
  $as_echo "296. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type union %defines
%token <int> ONE 101;
           %token <float> TWO 102 THREE 103;
           %printer { yyoutput << $$; } <int>
           %printer { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static int const input[] = { 101, 102, 103, EOF };
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_296
#AT_START_297
at_fn_group_banner 297 'types.at:128' \
  "lalr1.cc api.value.type=variant" "                " 11
at_xfail=no
(
  $as_echo "297. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type variant
%token <int> '1';
           %token <std::string> '2';

%%

start: '1' '2' { std::cout << $1 << ", " << $2 << std::endl; };

%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (*lvalp).build(10);
           else
             (*lvalp).build<std::string>("two");;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10, two
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_297
#AT_START_298
at_fn_group_banner 298 'types.at:128' \
  "lalr1.cc api.value.type=variant %defines" "       " 11
at_xfail=no
(
  $as_echo "298. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "lalr1.cc"
           %define api.value.type variant %defines
%token <int> '1';
           %token <std::string> '2';

%%

start: '1' '2' { std::cout << $1 << ", " << $2 << std::endl; };

%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (*lvalp).build(10);
           else
             (*lvalp).build<std::string>("two");;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10, two
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_298
#AT_START_299
at_fn_group_banner 299 'types.at:128' \
  "glr.cc api.value.type={double}" "                 " 11
at_xfail=no
(
  $as_echo "299. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_299
#AT_START_300
at_fn_group_banner 300 'types.at:128' \
  "glr.cc api.value.type={double} %defines" "        " 11
at_xfail=no
(
  $as_echo "300. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type {double} %defines


%%

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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_300
#AT_START_301
at_fn_group_banner 301 'types.at:128' \
  "glr.cc api.value.type={variant}" "                " 11
at_xfail=no
(
  $as_echo "301. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_301
#AT_START_302
at_fn_group_banner 302 'types.at:128' \
  "glr.cc api.value.type={variant} %defines" "       " 11
at_xfail=no
(
  $as_echo "302. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type {variant} %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp) = (res - '0') / 10.0;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_302
#AT_START_303
at_fn_group_banner 303 'types.at:128' \
  "glr.cc api.value.type={struct foo}" "             " 11
at_xfail=no
(
  $as_echo "303. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).ival = (res - '0') * 10;
           (*lvalp).fval = (res - '0') / 10.f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_303
#AT_START_304
at_fn_group_banner 304 'types.at:128' \
  "glr.cc api.value.type={struct foo} %defines" "    " 11
at_xfail=no
(
  $as_echo "304. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type {struct foo} %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).ival = (res - '0') * 10;
           (*lvalp).fval = (res - '0') / 10.f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "30 0.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_304
#AT_START_305
at_fn_group_banner 305 'types.at:128' \
  "glr.cc api.value.type={struct bar}" "             " 11
at_xfail=no
(
  $as_echo "305. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).up = (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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_305
#AT_START_306
at_fn_group_banner 306 'types.at:128' \
  "glr.cc api.value.type={struct bar} %defines" "    " 11
at_xfail=no
(
  $as_echo "306. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type {struct bar} %defines
%code requires
           {
             struct u
             {
               int ival;
             };
             struct bar
             {
               struct u *up;
             };
           }
           %token <up->ival> '1' '2'
           %printer { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  (*lvalp).up = (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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "1 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_306
#AT_START_307
at_fn_group_banner 307 'types.at:128' \
  "glr.cc api.value.type={union foo}" "              " 11
at_xfail=no
(
  $as_echo "307. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (*lvalp).ival = 10;
           else
             (*lvalp).fval = .2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_307
#AT_START_308
at_fn_group_banner 308 'types.at:128' \
  "glr.cc api.value.type={union foo} %defines" "     " 11
at_xfail=no
(
  $as_echo "308. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type {union foo} %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
             (*lvalp).ival = 10;
           else
             (*lvalp).fval = .2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_308
#AT_START_309
at_fn_group_banner 309 'types.at:128' \
  "glr.cc %union { float fval; int ival; };" "       " 11
at_xfail=no
(
  $as_echo "309. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (*lvalp).ival = 10;
             else
               (*lvalp).fval = 0.2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_309
#AT_START_310
at_fn_group_banner 310 'types.at:128' \
  "glr.cc %union { float fval; int ival; }; %defines" "" 11
at_xfail=no
(
  $as_echo "310. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
             %union { float fval; int ival; }; %defines
%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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "12";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == '1')
               (*lvalp).ival = 10;
             else
               (*lvalp).fval = 0.2f;
  return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_310
#AT_START_311
at_fn_group_banner 311 'types.at:128' \
  "glr.cc api.value.type=union" "                    " 11
at_xfail=no
(
  $as_echo "311. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type union
%token <int> ONE 101;
           %token <float> TWO 102 THREE 103;
           %printer { yyoutput << $$; } <int>
           %printer { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static int const input[] = { 101, 102, 103, EOF };
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_311
#AT_START_312
at_fn_group_banner 312 'types.at:128' \
  "glr.cc api.value.type=union %defines" "           " 11
at_xfail=no
(
  $as_echo "312. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >test.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%code
{
# include <stdio.h>
# include <stdlib.h>

static int yylex (yy::parser::semantic_type *lvalp);
}

%skeleton "glr.cc"
           %define api.value.type union %defines
%token <int> ONE 101;
           %token <float> TWO 102 THREE 103;
           %printer { yyoutput << $$; } <int>
           %printer { yyoutput << $$; } <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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static int const input[] = { 101, 102, 103, EOF };
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/types.at:128: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:128"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/types.at:128: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:128"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/types.at:128: bison -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:128"
( $at_check_trace; bison -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:128"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/types.at:128: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "types.at:128"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:128"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128:  \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:128"
( $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"; $as_echo "10 0.2 3.3
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/types.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.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_312
#AT_START_313
at_fn_group_banner 313 'types.at:263' \
  "lalr1.cc: Named %union" "                         " 11
at_xfail=no
(
  $as_echo "313. $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
$as_echo "$at_srcdir/types.at:263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:263"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:263"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'types.at:263' \
  "glr.cc: Named %union" "                           " 11
at_xfail=no
(
  $as_echo "314. $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
$as_echo "$at_srcdir/types.at:263: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "types.at:263"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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:263"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'calc.at:596' \
  "Calculator " "                                    " 12
at_xfail=no
(
  $as_echo "315. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */


%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:596"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:596"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:596"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:596"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:596: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:596"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:596: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:596"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:596: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; bison -fno-caret -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:596"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:596: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:596"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: \$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:596"
( $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:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: \$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:596"
( $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:596"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:596"
( $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:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:596:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:596"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:596: cat stderr"
at_fn_check_prepare_trace "calc.at:596"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:598' \
  "Calculator %defines" "                            " 12
at_xfail=no
(
  $as_echo "316. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%defines

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:598: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:598"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:598"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:598: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:598"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:598"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:598: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:598"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:598: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:598"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:598: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; bison -fno-caret -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:598"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:598: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:598"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: \$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:598"
( $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:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: \$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:598"
( $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:598"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:598"
( $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:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:598:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:598"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:598: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:598: cat stderr"
at_fn_check_prepare_trace "calc.at:598"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:599' \
  "Calculator %locations" "                          " 12
at_xfail=no
(
  $as_echo "317. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%locations

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:599"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:599"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:599: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:599"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:599"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:599"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:599: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:599"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:599: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; bison -fno-caret -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:599"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:599: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:599"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: \$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:599"
( $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:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: \$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:599"
( $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:599"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:599"
( $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:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:599:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:599"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:599: cat stderr"
at_fn_check_prepare_trace "calc.at:599"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:601' \
  "Calculator %name-prefix \"calc\"" "                 " 12
at_xfail=no
(
  $as_echo "318. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void calcerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:601"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:601"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:601: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:601"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:601"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:601: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:601"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:601: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:601"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:601: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; bison -fno-caret -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:601"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:601: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:601"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: \$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:601"
( $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:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: \$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:601"
( $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:601"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:601"
( $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:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:601:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:601"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:601: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:601: cat stderr"
at_fn_check_prepare_trace "calc.at:601"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:602' \
  "Calculator %verbose" "                            " 12
at_xfail=no
(
  $as_echo "319. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:602"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:602"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:602: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:602"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:602"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:602"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:602: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:602"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:602: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; bison -fno-caret -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:602"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:602: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:602"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: \$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:602"
( $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:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: \$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:602"
( $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:602"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:602"
( $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:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:602:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:602"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:602: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:602: cat stderr"
at_fn_check_prepare_trace "calc.at:602"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:603' \
  "Calculator %yacc" "                               " 12
at_xfail=no
(
  $as_echo "320. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:603"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:603"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:603: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:603"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:603"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:603"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:603: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:603"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:603: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; bison -fno-caret -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:603"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:603: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:603"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: \$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:603"
( $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:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: \$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:603"
( $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:603"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:603"
( $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:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:603:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:603"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:603: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:603: cat stderr"
at_fn_check_prepare_trace "calc.at:603"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:603"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:604' \
  "Calculator parse.error=verbose" "                 " 12
at_xfail=no
(
  $as_echo "321. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:604"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:604"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:604"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:604"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:604"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:604: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:604"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:604: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; bison -fno-caret -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:604"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:604: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:604"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: \$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:604"
( $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:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: \$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:604"
( $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:604"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:604"
( $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:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:604:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:604"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:604: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:604: cat stderr"
at_fn_check_prepare_trace "calc.at:604"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:606' \
  "Calculator api.pure=full %locations" "            " 12
at_xfail=no
(
  $as_echo "322. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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 int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


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_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:606: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:606"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:606"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:606: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:606"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:606"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:606: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:606"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:606: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:606"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:606: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; bison -fno-caret -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:606"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:606: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:606"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: \$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:606"
( $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:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: \$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:606"
( $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:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:606"
( $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:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:606: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:607' \
  "Calculator api.push-pull=both api.pure=full %locations" "" 12
at_xfail=no
(
  $as_echo "323. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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 int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


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_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:607"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:607"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:607"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:607"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:607"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:607: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:607"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:607: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; bison -fno-caret -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:607"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:607: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:607"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: \$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:607"
( $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:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: \$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:607"
( $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:607"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:607"
( $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:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:607:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:607"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:607: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:607: cat stderr"
at_fn_check_prepare_trace "calc.at:607"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:608' \
  "Calculator parse.error=verbose %locations" "      " 12
at_xfail=no
(
  $as_echo "324. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:608"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:608: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:608"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:608"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:608"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:608: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; bison -fno-caret -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:608"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:608: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:608"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: \$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:608"
( $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:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: \$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:608"
( $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:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:608"
( $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:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:608: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.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_324
#AT_START_325
at_fn_group_banner 325 'calc.at:610' \
  "Calculator parse.error=verbose %locations %defines api.prefix={calc} %verbose %yacc" "" 12
at_xfail=no
(
  $as_echo "325. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define parse.error verbose %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:610: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:610"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:610"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:610: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:610"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:610"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:610: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:610"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:610: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:610"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:610: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; bison -fno-caret -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:610"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:610: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:610"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: \$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:610"
( $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:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: \$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:610"
( $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:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:610"
( $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:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:610: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:611' \
  "Calculator parse.error=verbose %locations %defines %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc" "" 12
at_xfail=no
(
  $as_echo "326. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define parse.error verbose %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return TOK_NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return TOK_CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:611"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:611: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:611"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:611"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:611"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:611: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; bison -fno-caret -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:611"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:611: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:611"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: \$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:611"
( $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:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: \$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:611"
( $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:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:611"
( $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:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:611: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:613' \
  "Calculator %debug" "                              " 12
at_xfail=no
(
  $as_echo "327. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:613: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:613"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:613"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:613: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:613"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:613"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:613: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:613"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:613: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:613"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:613: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; bison -fno-caret -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:613"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:613: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:613"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: \$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:613"
( $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:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: \$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:613"
( $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:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:613"
( $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:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:613: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:614' \
  "Calculator parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
at_xfail=no
(
  $as_echo "328. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define parse.error verbose %debug %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:614"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:614"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:614: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:614"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:614"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:614"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:614: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:614"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:614: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; bison -fno-caret -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:614"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:614: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:614"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: \$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:614"
( $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:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: \$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:614"
( $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:614"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:614"
( $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:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:614:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:614"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:614: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:614: cat stderr"
at_fn_check_prepare_trace "calc.at:614"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:615' \
  "Calculator parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc" "" 12
at_xfail=no
(
  $as_echo "329. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define parse.error verbose %debug %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:615"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:615: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:615"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:615"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:615"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:615: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; bison -fno-caret -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:615"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:615: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:615"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: \$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:615"
( $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:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: \$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:615"
( $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:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:615"
( $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:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:615: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:617' \
  "Calculator api.pure=full parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 12
at_xfail=no
(
  $as_echo "330. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.pure full %define parse.error verbose %debug %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (YYLTYPE const * const llocp, const char *msg)
{
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


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_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:617: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:617"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:617: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:617"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:617"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:617: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:617"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:617: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:617"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:617: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; bison -fno-caret -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:617"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:617: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:617"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: \$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:617"
( $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:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: \$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:617"
( $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:617"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:617"
( $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:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:617:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:617"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:617: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:617: cat stderr"
at_fn_check_prepare_trace "calc.at:617"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:618' \
  "Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc" "" 12
at_xfail=no
(
  $as_echo "331. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.push-pull both %define api.pure full %define parse.error verbose %debug %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void calcerror (CALCLTYPE const * const llocp, 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         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (CALCLTYPE const * const llocp, const char *msg)
{
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);


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_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:618"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:618: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:618"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:618"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:618"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:618: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; bison -fno-caret -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:618"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:618: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:618"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: \$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:618"
( $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:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: \$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:618"
( $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:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:618"
( $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:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:620' \
  "Calculator api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 12
at_xfail=no
(
  $as_echo "332. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, 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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg)
{
  YYUSE(result);
  YYUSE(count);
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);


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_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:620"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:620: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:620"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:620: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; bison -fno-caret -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:620"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:620: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:620"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: \$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:620"
( $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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: \$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:620"
( $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:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:620"
( $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:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:620: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:637' \
  "Calculator %glr-parser " "                        " 13
at_xfail=no
(
  $as_echo "333. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:637: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:637"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:637"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:637: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:637"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:637"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:637: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:637"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:637: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:637"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:637: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; bison -fno-caret -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:637"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:637: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:637"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: \$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:637"
( $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:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: \$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:637"
( $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:637"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:637"
( $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:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:637:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:637"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:637: cat stderr"
at_fn_check_prepare_trace "calc.at:637"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:639' \
  "Calculator %glr-parser %defines" "                " 13
at_xfail=no
(
  $as_echo "334. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %defines

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:639"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:639"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:639: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:639"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:639"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:639: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:639"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:639: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:639"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:639: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; bison -fno-caret -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:639"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:639: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:639"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: \$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:639"
( $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:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: \$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:639"
( $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:639"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:639"
( $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:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:639:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:639"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:639: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:639: cat stderr"
at_fn_check_prepare_trace "calc.at:639"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:640' \
  "Calculator %glr-parser %locations" "              " 13
at_xfail=no
(
  $as_echo "335. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:640"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:640: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:640"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:640"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:640: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:640"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:640: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; bison -fno-caret -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:640"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:640: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:640"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: \$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:640"
( $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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: \$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:640"
( $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:640"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:640"
( $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:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:640:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:640"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:640: cat stderr"
at_fn_check_prepare_trace "calc.at:640"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:641' \
  "Calculator %glr-parser %name-prefix \"calc\"" "     " 13
at_xfail=no
(
  $as_echo "336. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void calcerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:641"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:641"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:641: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:641"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:641"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:641"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:641: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:641"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:641: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; bison -fno-caret -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:641"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:641: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:641"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: \$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:641"
( $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:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: \$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:641"
( $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:641"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:641"
( $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:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:641:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:641"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:641: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:641: cat stderr"
at_fn_check_prepare_trace "calc.at:641"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.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_336
#AT_START_337
at_fn_group_banner 337 'calc.at:642' \
  "Calculator %glr-parser api.prefix={calc}" "       " 13
at_xfail=no
(
  $as_echo "337. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void calcerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:642"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:642"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:642: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:642"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:642"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:642"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:642: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:642"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:642: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; bison -fno-caret -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:642"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:642: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:642"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: \$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:642"
( $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:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: \$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:642"
( $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:642"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:642"
( $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:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:642:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:642"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:642: cat stderr"
at_fn_check_prepare_trace "calc.at:642"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.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_337
#AT_START_338
at_fn_group_banner 338 'calc.at:643' \
  "Calculator %glr-parser %verbose" "                " 13
at_xfail=no
(
  $as_echo "338. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:643"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:643"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:643: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:643"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:643"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:643"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:643: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:643"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:643: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; bison -fno-caret -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:643"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:643: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:643"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: \$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:643"
( $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:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: \$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:643"
( $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:643"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:643"
( $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:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:643:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:643"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:643: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:643: cat stderr"
at_fn_check_prepare_trace "calc.at:643"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:644' \
  "Calculator %glr-parser %yacc" "                   " 13
at_xfail=no
(
  $as_echo "339. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %yacc

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:644"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:644: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:644"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:644"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:644"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:644: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; bison -fno-caret -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:644"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:644: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:644"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: \$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:644"
( $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:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: \$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:644"
( $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:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:644"
( $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:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:645' \
  "Calculator %glr-parser parse.error=verbose" "     " 13
at_xfail=no
(
  $as_echo "340. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:645: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; bison -fno-caret -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:645"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:645: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:645"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: \$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:645"
( $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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: \$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:645"
( $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:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:645"
( $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:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.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_340
#AT_START_341
at_fn_group_banner 341 'calc.at:647' \
  "Calculator %glr-parser api.pure %locations" "     " 13
at_xfail=no
(
  $as_echo "341. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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 int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


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_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:647: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:647"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:647"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:647: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:647"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:647"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:647: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:647"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:647: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:647"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:647: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; bison -fno-caret -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:647"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:647: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:647"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: \$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:647"
( $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:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: \$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:647"
( $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:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:647"
( $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:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.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_341
#AT_START_342
at_fn_group_banner 342 'calc.at:648' \
  "Calculator %glr-parser parse.error=verbose %locations" "" 13
at_xfail=no
(
  $as_echo "342. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:648"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:648"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:648: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:648"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:648"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:648"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:648: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:648"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:648: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; bison -fno-caret -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:648"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:648: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:648"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: \$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:648"
( $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:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: \$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:648"
( $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:648"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:648"
( $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:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:648:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:648"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:648: cat stderr"
at_fn_check_prepare_trace "calc.at:648"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:648"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:650' \
  "Calculator %glr-parser parse.error=verbose %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 13
at_xfail=no
(
  $as_echo "343. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:650: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:650"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:650"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:650: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:650"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:650"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:650: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:650"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:650: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:650"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:650: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; bison -fno-caret -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:650"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:650: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:650"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: \$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:650"
( $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:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: \$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:650"
( $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:650"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:650"
( $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:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:650:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:650"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:650: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:650: cat stderr"
at_fn_check_prepare_trace "calc.at:650"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:652' \
  "Calculator %glr-parser %debug" "                  " 13
at_xfail=no
(
  $as_echo "344. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* 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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {

    }
  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;
}

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:652: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:652"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:652"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:652: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:652"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:652"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:652: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:652"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:652: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:652"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:652: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; bison -fno-caret -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:652"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:652: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:652"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: \$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:652"
( $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:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: \$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:652"
( $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:652"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:652"
( $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:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:652:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:652"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:652: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:652: cat stderr"
at_fn_check_prepare_trace "calc.at:652"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:652"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:653' \
  "Calculator %glr-parser parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 13
at_xfail=no
(
  $as_echo "345. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %debug %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:653"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:653"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:653: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:653"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:653"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:653"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:653: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:653"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:653: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; bison -fno-caret -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:653"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:653: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:653"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: \$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:653"
( $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:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: \$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:653"
( $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:653"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:653"
( $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:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:653:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:653"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:653: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:653: cat stderr"
at_fn_check_prepare_trace "calc.at:653"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:653"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:654' \
  "Calculator %glr-parser parse.error=verbose %debug %locations %defines api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc" "" 13
at_xfail=no
(
  $as_echo "346. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %debug %locations %defines %define api.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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (const char *msg)
{
  LOCATION_PRINT (stderr, (calclloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


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_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;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }
  while ((c = get_char ()) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return TOK_NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return TOK_CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:654"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:654"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:654: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:654"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:654"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:654"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:654: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:654"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:654: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; bison -fno-caret -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:654"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:654: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:654"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: \$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:654"
( $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:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: \$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:654"
( $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:654"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:654"
( $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:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:654:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:654"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:654: cat stderr"
at_fn_check_prepare_trace "calc.at:654"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:654"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:656' \
  "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc" "" 13
at_xfail=no
(
  $as_echo "347. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %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 (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (YYLTYPE const * const llocp, const char *msg)
{
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


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_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:656: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:656"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:656"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:656: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:656"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:656"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:656: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:656"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:656: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:656"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:656: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; bison -fno-caret -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:656"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:656: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:656"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: \$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:656"
( $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:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: \$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:656"
( $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:656"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:656"
( $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:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:656:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:656"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:656: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:656: cat stderr"
at_fn_check_prepare_trace "calc.at:656"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:656"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:658' \
  "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13
at_xfail=no
(
  $as_echo "348. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, 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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg)
{
  YYUSE(result);
  YYUSE(count);
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


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_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:658: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:658"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:658"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:658: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:658"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:658"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:658: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:658"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:658: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:658"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:658: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; bison -fno-caret -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:658"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:658: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:658"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: \$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:658"
( $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:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: \$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:658"
( $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:658"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:658"
( $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:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:658:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:658"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:658: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:658: cat stderr"
at_fn_check_prepare_trace "calc.at:658"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:658"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:659' \
  "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 13
at_xfail=no
(
  $as_echo "349. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}

%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { fprintf (yyoutput, "%d", $$); } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);

#include <stdio.h>

#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, 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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 unsigned
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg)
{
  YYUSE(result);
  YYUSE(count);
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static int get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static void unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp,  int c);


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_signed_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 current token, then white spaces.  */
  do
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <assert.h>
#include <unistd.h>



semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  calcdebug = 1;
  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:659"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:659"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:659: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.c calc.y" "calc.at:659"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:659"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:659"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:659: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:659"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:659: bison -fno-caret -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; bison -fno-caret -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:659"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/calc.at:659: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "calc.at:659"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: \$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:659"
( $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:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: \$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:659"
( $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:659"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:659"
( $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:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:659:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:659"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:659: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:659: cat stderr"
at_fn_check_prepare_trace "calc.at:659"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:659"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:669' \
  "Calculator lalr1.cc %defines" "                   " 14
at_xfail=no
(
  $as_echo "350. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%skeleton "lalr1.cc" %defines
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp);
static int get_char (yy::parser::semantic_type *lvalp);
static void unget_char (yy::parser::semantic_type *lvalp,  int c);


static int
get_char (yy::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (yy::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (yy::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:669: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:669"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:669"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:669: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:669"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:669"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:669: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:669"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:669: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:669"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:669: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; bison -fno-caret -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:669"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:669: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:669"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:669"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: \$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:669"
( $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:669"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:669"
( $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:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:669:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:669"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:669: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:669: cat stderr"
at_fn_check_prepare_trace "calc.at:669"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:678' \
  "Calculator C++ " "                                " 14
at_xfail=no
(
  $as_echo "351. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++"
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp);
static int get_char (yy::parser::semantic_type *lvalp);
static void unget_char (yy::parser::semantic_type *lvalp,  int c);


static int
get_char (yy::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (yy::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (yy::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:678: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:678"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:678"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:678: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:678"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:678"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:678: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:678"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:678: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:678"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:678: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; bison -fno-caret -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:678"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:678: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:678"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:678"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: \$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:678"
( $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:678"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:678"
( $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:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:678:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:678"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:678: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:678: cat stderr"
at_fn_check_prepare_trace "calc.at:678"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:679' \
  "Calculator C++ %locations" "                      " 14
at_xfail=no
(
  $as_echo "352. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %locations
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);


static yy::parser::location_type last_yylloc;

static int
get_char (yy::parser::semantic_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::semantic_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_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:679"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:679: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:679"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:679"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:679"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:679: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; bison -fno-caret -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:679"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:679: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:679"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:679"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: \$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:679"
( $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:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:679"
( $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:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:680' \
  "Calculator C++ %locations api.location.type={Span}" "" 14
at_xfail=no
(
  $as_echo "353. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %locations %define api.location.type {Span}
%define global_tokens_and_yystype
%code requires
{

# include <iostream>
  struct Point
  {
    int l;
    int c;
  };

  struct Span
  {
    Point first;
    Point last;
  };

# 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 (false)


  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static int
power (int base, int exponent)
{
  int res = 1;
  assert (0 <= exponent);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


  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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);


static yy::parser::location_type last_yylloc;

static int
get_char (yy::parser::semantic_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::semantic_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_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).first.c = (*llocp).last.c;
      (*llocp).first.l   = (*llocp).last.l;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:680"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:680"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:680: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:680"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:680"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:680"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:680: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:680"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:680: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; bison -fno-caret -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:680"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:680: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:680"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:680"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: \$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:680"
( $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:680"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:680"
( $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:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:680:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:680"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:680: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:680: cat stderr"
at_fn_check_prepare_trace "calc.at:680"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:681' \
  "Calculator C++ %defines %locations parse.error=verbose %name-prefix \"calc\" %verbose %yacc" "" 14
at_xfail=no
(
  $as_echo "354. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %define parse.error verbose %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:681"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:681"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:681: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:681"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:681"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:681"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:681: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:681"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:681: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; bison -fno-caret -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:681"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:681: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:681"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:681"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: \$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:681"
( $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:681"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:681"
( $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:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:681:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:681"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:681: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:681: cat stderr"
at_fn_check_prepare_trace "calc.at:681"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:681"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:683' \
  "Calculator C++ %locations parse.error=verbose api.prefix={calc} %verbose %yacc" "" 14
at_xfail=no
(
  $as_echo "355. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %locations %define parse.error verbose %define api.prefix {calc} %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:683"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:683"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:683: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:683"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:683"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:683"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:683: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:683"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:683: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; bison -fno-caret -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:683"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:683: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:683"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:683"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: \$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:683"
( $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:683"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:683"
( $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:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:683:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:683"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:683: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:683: cat stderr"
at_fn_check_prepare_trace "calc.at:683"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:683"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:684' \
  "Calculator C++ %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 14
at_xfail=no
(
  $as_echo "356. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:684: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:684"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:684"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:684: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:684"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:684"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:684: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:684"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:684: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:684"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:684: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; bison -fno-caret -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:684"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:684: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:684"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:684"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: \$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:684"
( $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:684"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:684"
( $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:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:684:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:684"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:684: cat stderr"
at_fn_check_prepare_trace "calc.at:684"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:686' \
  "Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc" "" 14
at_xfail=no
(
  $as_echo "357. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %locations %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:686: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:686"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:686"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:686: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:686"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:686"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:686: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:686"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:686: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:686"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:686: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; bison -fno-caret -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:686"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:686: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:686"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:686"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: \$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:686"
( $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:686"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:686"
( $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:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:686:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:686"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:686: cat stderr"
at_fn_check_prepare_trace "calc.at:686"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:686"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:687' \
  "Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc" "" 14
at_xfail=no
(
  $as_echo "358. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %locations %define parse.error verbose %debug %define api.prefix {calc} %define api.token.prefix {TOK_} %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return TOK_NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return TOK_CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:687"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:687"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:687: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:687"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:687"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:687"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:687: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:687"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:687: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; bison -fno-caret -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:687"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:687: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:687"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:687"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: \$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:687"
( $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:687"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:687"
( $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:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:687:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:687"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:687: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:687: cat stderr"
at_fn_check_prepare_trace "calc.at:687"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:687"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:689' \
  "Calculator C++ %defines %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14
at_xfail=no
(
  $as_echo "359. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:689: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:689"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:689"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:689: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:689"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:689"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:689: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:689"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:689: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:689"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:689: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; bison -fno-caret -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:689"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:689: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:689"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:689"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: \$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:689"
( $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:689"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:689"
( $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:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:689:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:689"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:689: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:689: cat stderr"
at_fn_check_prepare_trace "calc.at:689"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:689"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:691' \
  "Calculator C++ parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14
at_xfail=no
(
  $as_echo "360. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_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         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp);
static int get_char (calc::parser::semantic_type *lvalp);
static void unget_char (calc::parser::semantic_type *lvalp,  int c);


static int
get_char (calc::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (calc::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:691: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:691"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:691"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:691: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:691"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:691"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:691: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:691"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:691: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:691"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:691: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; bison -fno-caret -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:691"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:691: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:691"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:691"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: \$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:691"
( $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:691"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:691"
( $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:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:691:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:691"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:691: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:691: cat stderr"
at_fn_check_prepare_trace "calc.at:691"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:691"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:692' \
  "Calculator C++ %defines %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 14
at_xfail=no
(
  $as_echo "361. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:692: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:692"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:692"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:692: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:692"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:692"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:692: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:692"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:692: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:692"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:692: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; bison -fno-caret -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:692"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:692: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:692"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:692"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: \$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:692"
( $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:692"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:692"
( $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:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:692:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:692"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:692: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:692: cat stderr"
at_fn_check_prepare_trace "calc.at:692"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:692"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:703' \
  "Calculator glr.cc" "                              " 15
at_xfail=no
(
  $as_echo "362. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%skeleton "glr.cc"
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp);
static int get_char (yy::parser::semantic_type *lvalp);
static void unget_char (yy::parser::semantic_type *lvalp,  int c);


static int
get_char (yy::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (yy::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (yy::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:703: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:703"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:703"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:703: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:703"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:703"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:703: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:703"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:703: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:703"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:703: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; bison -fno-caret -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:703"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:703: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:703"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:703"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: \$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:703"
( $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:703"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:703"
( $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:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:703:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:703"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:703: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:703: cat stderr"
at_fn_check_prepare_trace "calc.at:703"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:703"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:712' \
  "Calculator C++ %glr-parser " "                    " 15
at_xfail=no
(
  $as_echo "363. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp);
static int get_char (yy::parser::semantic_type *lvalp);
static void unget_char (yy::parser::semantic_type *lvalp,  int c);


static int
get_char (yy::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (yy::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (yy::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:712"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:712"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:712: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:712"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:712"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:712: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:712"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:712: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:712"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:712: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; bison -fno-caret -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:712"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:712: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:712"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:712"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: \$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:712"
( $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:712"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:712"
( $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:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:712:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:712"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:712: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:712: cat stderr"
at_fn_check_prepare_trace "calc.at:712"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:712"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:713' \
  "Calculator C++ %glr-parser %locations" "          " 15
at_xfail=no
(
  $as_echo "364. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %locations
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);


static yy::parser::location_type last_yylloc;

static int
get_char (yy::parser::semantic_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::semantic_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_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:713"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:713: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:713"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:713: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; bison -fno-caret -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:713"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:713: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:713"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:713"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: \$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:713"
( $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:713"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:713"
( $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:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:713:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:713"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:713: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:713: cat stderr"
at_fn_check_prepare_trace "calc.at:713"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:714' \
  "Calculator C++ %glr-parser %locations api.location.type={Span}" "" 15
at_xfail=no
(
  $as_echo "365. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %locations %define api.location.type {Span}
%define global_tokens_and_yystype
%code requires
{

# include <iostream>
  struct Point
  {
    int l;
    int c;
  };

  struct Span
  {
    Point first;
    Point last;
  };

# 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 (false)


  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static int
power (int base, int exponent)
{
  int res = 1;
  assert (0 <= exponent);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


  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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static int get_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
static void unget_char (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp,  int c);


static yy::parser::location_type last_yylloc;

static int
get_char (yy::parser::semantic_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::semantic_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_signed_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).first.c = (*llocp).last.c;
      (*llocp).first.l   = (*llocp).last.l;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:714"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:714"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:714: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:714"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:714"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:714"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:714: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:714"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:714: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; bison -fno-caret -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:714"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:714: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:714"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:714"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: \$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:714"
( $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:714"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:714"
( $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:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:714:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:714"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:714: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:714: cat stderr"
at_fn_check_prepare_trace "calc.at:714"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:714"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:715' \
  "Calculator C++ %glr-parser %defines parse.error=verbose %name-prefix \"calc\" %verbose %yacc" "" 15
at_xfail=no
(
  $as_echo "366. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %define parse.error verbose %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp);
static int get_char (calc::parser::semantic_type *lvalp);
static void unget_char (calc::parser::semantic_type *lvalp,  int c);


static int
get_char (calc::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (calc::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:715: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:715"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:715"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:715: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:715"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:715"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:715: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:715"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:715: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:715"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:715: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; bison -fno-caret -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:715"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:715: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:715"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:715"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: \$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:715"
( $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:715"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:715"
( $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:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:715:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:715"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:715: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:715: cat stderr"
at_fn_check_prepare_trace "calc.at:715"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:715"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:716' \
  "Calculator C++ %glr-parser parse.error=verbose api.prefix={calc} %verbose %yacc" "" 15
at_xfail=no
(
  $as_echo "367. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %define parse.error verbose %define api.prefix {calc} %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp);
static int get_char (calc::parser::semantic_type *lvalp);
static void unget_char (calc::parser::semantic_type *lvalp,  int c);


static int
get_char (calc::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (calc::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:716"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:716"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:716: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:716"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:716"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:716"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:716: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:716"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:716: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; bison -fno-caret -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:716"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:716: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:716"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:716"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: \$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:716"
( $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:716"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:716"
( $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:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:716:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:716"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:716: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:716: cat stderr"
at_fn_check_prepare_trace "calc.at:716"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:716"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:718' \
  "Calculator C++ %glr-parser %debug" "              " 15
at_xfail=no
(
  $as_echo "368. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %debug
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int yylex (yy::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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 << std::endl;
}
#include <ctype.h>

int yylex (yy::parser::semantic_type *lvalp);
static int get_char (yy::parser::semantic_type *lvalp);
static void unget_char (yy::parser::semantic_type *lvalp,  int c);


static int
get_char (yy::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (yy::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (yy::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ yyparse that simulates the C signature.  */
int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:718"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:718"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:718: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:718"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:718"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:718"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:718: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:718"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:718: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; bison -fno-caret -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:718"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:718: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:718"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:718"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: \$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:718"
( $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:718"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:718"
( $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:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:718:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:718"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:718: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:718: cat stderr"
at_fn_check_prepare_trace "calc.at:718"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:718"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:720' \
  "Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc" "" 15
at_xfail=no
(
  $as_echo "369. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp);
static int get_char (calc::parser::semantic_type *lvalp);
static void unget_char (calc::parser::semantic_type *lvalp,  int c);


static int
get_char (calc::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (calc::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:720: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:720"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:720"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:720: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:720"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:720"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:720: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:720"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:720: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:720"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:720: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; bison -fno-caret -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:720"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:720: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:720"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:720"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: \$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:720"
( $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:720"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:720"
( $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:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:720:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:720"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:720: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:720: cat stderr"
at_fn_check_prepare_trace "calc.at:720"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:721' \
  "Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc" "" 15
at_xfail=no
(
  $as_echo "370. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %define parse.error verbose %debug %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_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                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp);
static int get_char (calc::parser::semantic_type *lvalp);
static void unget_char (calc::parser::semantic_type *lvalp,  int c);


static int
get_char (calc::parser::semantic_type *lvalp)
{
  int res = getc (input);
  (void) lvalp;;

  return res;
}

static void
unget_char (calc::parser::semantic_type *lvalp,  int c)
{
  (void) lvalp;;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp)
{
  int c = get_char (lvalp);
  int sign = 1;
  int n = 0;

  (void) lvalp;;
  if (c == '-')
    {
      c = get_char (lvalp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp);
    }

  unget_char (lvalp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {

    }
  while ((c = get_char (lvalp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp,  c);
      (*lvalp).ival = read_signed_integer (lvalp);
      return TOK_NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return TOK_CALC_EOF;

  /* Return single chars. */
  return c;
}

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse ();
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:721"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:721: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:721"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:721: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:721"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:721: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; bison -fno-caret -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:721"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:721: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:721"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:721"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: \$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:721"
( $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:721"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:721"
( $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:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: 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 error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:721:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:721"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:721: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:721: cat stderr"
at_fn_check_prepare_trace "calc.at:721"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:723' \
  "Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 15
at_xfail=no
(
  $as_echo "371. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %locations %defines %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:723"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:723"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:723: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:723"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:723"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:723: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:723"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:723: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:723"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:723: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; bison -fno-caret -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:723"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:723: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:723"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:723"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: \$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:723"
( $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:723"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:723"
( $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:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:723:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:723"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:723: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:723: cat stderr"
at_fn_check_prepare_trace "calc.at:723"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:723"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'calc.at:724' \
  "Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}" "" 15
at_xfail=no
(
  $as_echo "372. $at_setup_line: testing $at_desc ..."
  $at_traceon










cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %locations %defines %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires
{

  /* Exercise pre-prologue dependency to %union.  */
  typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};
%printer { yyoutput << $$; } <ival>;

%code provides
{
  #include <stdio.h>
  /* The input.  */
  extern FILE *input;
  extern semantic_value global_result;
  extern int global_count;
}

%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)

FILE *input;
static int power (int base, int exponent);


int calclex (calc::parser::semantic_type *lvalp, calc::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         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static 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
calc::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
_ATEOF



cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static int get_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp);
static void unget_char (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c);


static calc::parser::location_type last_yylloc;

static int
get_char (calc::parser::semantic_type *lvalp, calc::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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == '\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| 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 (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp)
{
  int c;
  /* Skip current token, then white spaces.  */
  do
    {
     (*llocp).begin.column = (*llocp).end.column;
      (*llocp).begin.line   = (*llocp).end.line;

    }
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t');

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF


cat >calc-main.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <assert.h>
#include <unistd.h>


/* A C++ calcparse that simulates the C signature.  */
int
calcparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if CALCDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}


semantic_value global_result = 0;
int global_count = 0;

/* A C main function.  */
int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* 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);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = calcparse (&result, &count);
  if (fclose (input))
    perror ("fclose");
  assert (global_result == result); (void) result;
  assert (global_count == count);   (void) count;
  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
$as_echo "$at_srcdir/calc.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:724: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o calc.cc calc.y" "calc.at:724"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:724: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:724"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/calc.at:724: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:724"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/calc.at:724: bison -fno-caret -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; bison -fno-caret -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:724"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/calc.at:724: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:724"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:724"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: \$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:724"
( $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:724"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }




# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /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 number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:724"
( $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:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$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

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$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 succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:724:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:724"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:724: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }



# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the', unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:724: cat stderr"
at_fn_check_prepare_trace "calc.at:724"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'torture.at:132' \
  "Big triangle" "                                   " 16
at_xfail=no
(
  $as_echo "373. $at_setup_line: testing $at_desc ..."
  $at_traceon


# I have been able to go up to 2000 on my machine.
# I tried 3000, a 29Mb grammar file, but then my system killed bison.
# With 500 and the new parser, which consume far too much memory,
# it gets killed too.  Of course the parser is to be cleaned.

cat >gengram.pl <<'_ATEOF'
#! /usr/bin/perl -w

use strict;
my $max = $ARGV[0] || 10;

print <<EOF;
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%{
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define MAX $max
static int yylex (void);
#include <stdio.h>

static void yyerror (const char *msg);
%}
%union
{
  int val;
};

%token END "end"
%type <val> exp input
EOF

for my $size (1 .. $max)
  {
    print "%token t$size $size \"$size\"\n";
  };

print <<EOF;
%%
input:
  exp        { assert (\$1 == 0); \$\$ = \$1; }
| input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
;

exp:
  END
    { \$\$ = 0; }
EOF

for my $size (1 .. $max)
  {
    use Text::Wrap;
    print wrap ("| ", "   ",
                (map { "\"$_\"" } (1 .. $size)),
                " END \n"),
                  "    { \$\$ = $size; }\n";
  };
print ";\n";

print <<\EOF;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int inner = 1;
  static int outer = 0;
  if (outer > MAX)
    return 0;
  else if (inner > outer)
    {
      inner = 1;
      ++outer;
      return END;
    }
  return inner++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  (void) argc;
  (void) argv;
  return yyparse ();
}
EOF
_ATEOF



{ set +x
$as_echo "$at_srcdir/torture.at:138: \$PERL -w ./gengram.pl 200 || exit 77"
at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 200 || exit 77" "torture.at:138"
( $at_check_trace; $PERL -w ./gengram.pl 200 || 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 stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:138"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout input.y

{ set +x
$as_echo "$at_srcdir/torture.at:139: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:139"
( $at_check_trace; bison -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/torture.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:140: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:140"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:140"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:140: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:140"
( $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/torture.at:140"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:141:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:141"
( $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/torture.at:141"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:141: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:141"
( $at_check_trace; 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/torture.at:141"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'torture.at:216' \
  "Big horizontal" "                                 " 16
at_xfail=no
(
  $as_echo "374. $at_setup_line: testing $at_desc ..."
  $at_traceon


# I have been able to go up to 10000 on my machine, but I had to
# increase the maximum stack size (* 100).  It gave:
#
# input.y      263k
# input.tab.c  1.3M
# input        453k
#
# gengram.pl 10000                 0.70s user 0.01s sys  99% cpu    0.711 total
# bison input.y                  730.56s user 0.53s sys  99% cpu 12:12.34 total
# gcc -Wall input.tab.c -o input   5.81s user 0.20s sys 100% cpu     6.01 total
# ./input                          0.00s user 0.01s sys 108% cpu     0.01 total
#

cat >gengram.pl <<'_ATEOF'
#! /usr/bin/perl -w

use strict;
my $max = $ARGV[0] || 10;

print <<EOF;
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%{
#include <stdio.h>
#include <stdlib.h>
#define MAX $max
static int yylex (void);
#include <stdio.h>

static void yyerror (const char *msg);
%}

%token
EOF
for my $size (1 .. $max)
  {
    print "    t$size $size \"$size\"\n";
  };

print <<EOF;

%%
EOF

use Text::Wrap;
print
  wrap ("exp: ", "  ",
        (map { "\"$_\"" } (1 .. $max)), ";"),
  "\n";

print <<\EOF;
%%
#include <assert.h>


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int counter = 1;
  if (counter <= MAX)
    return counter++;
  assert (counter++ == MAX + 1);
  return 0;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  (void) argc;
  (void) argv;
  return yyparse ();
}
EOF
_ATEOF


{ set +x
$as_echo "$at_srcdir/torture.at:230: \$PERL -w ./gengram.pl 1000 || exit 77"
at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:230"
( $at_check_trace; $PERL -w ./gengram.pl 1000 || 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 stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:230"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout input.y



# GNU m4 requires about 70 MiB for this test on a 32-bit host.
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
data_limit=`(ulimit -S -d) 2>/dev/null`
case $data_limit in
[0-9]*)
  if test "$data_limit" -lt 204000; then
    { set +x
$as_echo "$at_srcdir/torture.at:234: ulimit -S -d 204000 || exit 77"
at_fn_check_prepare_trace "torture.at:234"
( $at_check_trace; ulimit -S -d 204000 || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:234"
$at_failed && at_fn_log_failure
$at_traceon; }

    ulimit -S -d 204000
  fi
esac

{ set +x
$as_echo "$at_srcdir/torture.at:236: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:236"
( $at_check_trace; bison -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/torture.at:236"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:237: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:237"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:237: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:237"
( $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/torture.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:238:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:238"
( $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/torture.at:238"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:238: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:238"
( $at_check_trace; 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/torture.at:238"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'torture.at:348' \
  "Many lookahead tokens" "                          " 16
at_xfail=no
(
  $as_echo "375. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >gengram.pl <<'_ATEOF'
#! /usr/bin/perl -w

use strict;
use Text::Wrap;
my $max = $ARGV[0] || 10;

print <<EOF;
%error-verbose
%debug
%{
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
# define MAX $max
static int yylex (void);
#include <stdio.h>

static void yyerror (const char *msg);
%}
%union
{
  int val;
};

%type <val> input exp
%token token
EOF

print
  wrap ("%type <val> ",
        "            ",
        map { "n$_" } (1 .. $max)),
  "\n";

print "%token\n";
for my $count (1 .. $max)
  {
    print "    t$count $count \"$count\"\n";
  };

print <<EOF;
%%
input:
  exp        { assert (\$1 == 1); \$\$ = \$1; }
| input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
;

exp:
  n1 "1" { assert (\$1 == 1); \$\$ = \$1; }
EOF

for my $count (2 .. $max)
  {
    print "| n$count \"$count\" { assert (\$1 == $count); \$\$ = \$1; }\n";
  };
print ";\n";

for my $count (1 .. $max)
  {
    print "n$count: token { \$\$ = $count; };\n";
  };

print <<\EOF;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int return_token = 1;
  static int counter = 1;
  if (counter > MAX)
    {
      assert (counter++ == MAX + 1);
      return 0;
    }
  if (return_token)
    {
      return_token = 0;
      return token;
    }
  return_token = 1;
  return counter++;
}

#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  (void) argc;
  (void) argv;
  return yyparse ();
}
EOF
_ATEOF


{ set +x
$as_echo "$at_srcdir/torture.at:350: \$PERL -w ./gengram.pl 1000 || exit 77"
at_fn_check_prepare_dynamic "$PERL -w ./gengram.pl 1000 || exit 77" "torture.at:350"
( $at_check_trace; $PERL -w ./gengram.pl 1000 || 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 stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:350"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout input.y



# GNU m4 requires about 70 MiB for this test on a 32-bit host.
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
data_limit=`(ulimit -S -d) 2>/dev/null`
case $data_limit in
[0-9]*)
  if test "$data_limit" -lt 204000; then
    { set +x
$as_echo "$at_srcdir/torture.at:354: ulimit -S -d 204000 || exit 77"
at_fn_check_prepare_trace "torture.at:354"
( $at_check_trace; ulimit -S -d 204000 || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }

    ulimit -S -d 204000
  fi
esac

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/torture.at:356: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:356"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/torture.at:356"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:356: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "torture.at:356"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/torture.at:356"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:356: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:356"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:356"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/torture.at:356: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:356"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:356"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/torture.at:356: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:356"
( $at_check_trace; bison -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/torture.at:356"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:357: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:357"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:357"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:357: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:357"
( $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/torture.at:357"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:358:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:358"
( $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/torture.at:358"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:358"
( $at_check_trace; 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/torture.at:358"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'torture.at:450' \
  "Exploding the Stack Size with Alloca" "           " 16
at_xfail=no
(
  $as_echo "376. $at_setup_line: testing $at_desc ..."
  $at_traceon





# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \
     || defined _AIX || defined _MSC_VER || defined _ALLOCA_H)
# define YYSTACK_USE_ALLOCA 1
#endif

  static int yylex (void);
  #include <stdio.h>

static void yyerror (const char *msg);
%}

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static int
yylex (void)
{
  assert (0 <= yylval);
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

/* Return argv[1] as an int. */
static int
get_args (int argc, const char **argv)
{
  int res;
  char *endp;
  assert (argc == 2); (void) argc;
  res = strtol (argv[1], &endp, 10);
  assert (argv[1] != endp);
  assert (0 <= res);
  assert (res <= INT_MAX);
  assert (errno != ERANGE);
  return res;
}

int
main (int argc, const char **argv)
{
  YYSTYPE yylval_init = get_args (argc, argv);
  int status = 0;
  int count;
  yydebug = 1;
  for (count = 0; count < 2; ++count)
    {
      int new_status;
      yylval = yylval_init;
      new_status = yyparse ();
      if (count == 0)
        status = new_status;
      else
        assert (new_status == status);
    }
  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
$as_echo "$at_srcdir/torture.at:459: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:459"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:459: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:459"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:459: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:459"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/torture.at:459: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:459"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/torture.at:459: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "torture.at:459"
( $at_check_trace; bison -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/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:459: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:459"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:459: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:459"
( $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/torture.at:459"
$at_failed && at_fn_log_failure
$at_traceon; }



# Below the limit of 200.
{ set +x
$as_echo "$at_srcdir/torture.at:462: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:462"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:462"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:462: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:462"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:462"
$at_failed && at_fn_log_failure
$at_traceon; }


# Two enlargements: 2 * 2 * 200.
{ set +x
$as_echo "$at_srcdir/torture.at:465: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:465"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:465"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:465: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:465"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:465"
$at_failed && at_fn_log_failure
$at_traceon; }


# Fails: beyond the limit of 10,000 (which we don't reach anyway since we
# multiply by two starting at 200 => 5120 is the last possible).
{ set +x
$as_echo "$at_srcdir/torture.at:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:469"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/torture.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:469: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:469"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }



# The push parser can't use alloca since the stacks can't be locals.  This test
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
# push parsers.

# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \
     || defined _AIX || defined _MSC_VER || defined _ALLOCA_H)
# define YYSTACK_USE_ALLOCA 1
#endif

  static int yylex (void);
  #include <stdio.h>

static void yyerror (const char *msg);
%}
%define api.push-pull both

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static int
yylex (void)
{
  assert (0 <= yylval);
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

/* Return argv[1] as an int. */
static int
get_args (int argc, const char **argv)
{
  int res;
  char *endp;
  assert (argc == 2); (void) argc;
  res = strtol (argv[1], &endp, 10);
  assert (argv[1] != endp);
  assert (0 <= res);
  assert (res <= INT_MAX);
  assert (errno != ERANGE);
  return res;
}

int
main (int argc, const char **argv)
{
  YYSTYPE yylval_init = get_args (argc, argv);
  int status = 0;
  int count;
  yypstate *ps = yypstate_new ();
  yydebug = 1;
  for (count = 0; count < 2; ++count)
    {
      int new_status;
      yylval = yylval_init;
      new_status = yypull_parse (ps);
      if (count == 0)
        status = new_status;
      else
        assert (new_status == status);
    }
  yypstate_delete (ps);
  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
$as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:475"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:475: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:475"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/torture.at:475: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:475"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/torture.at:475: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "torture.at:475"
( $at_check_trace; bison -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/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:475: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:475"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:475: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:475"
( $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/torture.at:475"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:478: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:478"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.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
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:480: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:480"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:482: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:482"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:482: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:482"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'torture.at:496' \
  "Exploding the Stack Size with Malloc" "           " 16
at_xfail=no
(
  $as_echo "377. $at_setup_line: testing $at_desc ..."
  $at_traceon





# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define YYSTACK_USE_ALLOCA 0
  static int yylex (void);
  #include <stdio.h>

static void yyerror (const char *msg);
%}

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static int
yylex (void)
{
  assert (0 <= yylval);
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

/* Return argv[1] as an int. */
static int
get_args (int argc, const char **argv)
{
  int res;
  char *endp;
  assert (argc == 2); (void) argc;
  res = strtol (argv[1], &endp, 10);
  assert (argv[1] != endp);
  assert (0 <= res);
  assert (res <= INT_MAX);
  assert (errno != ERANGE);
  return res;
}

int
main (int argc, const char **argv)
{
  YYSTYPE yylval_init = get_args (argc, argv);
  int status = 0;
  int count;
  yydebug = 1;
  for (count = 0; count < 2; ++count)
    {
      int new_status;
      yylval = yylval_init;
      new_status = yyparse ();
      if (count == 0)
        status = new_status;
      else
        assert (new_status == status);
    }
  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
$as_echo "$at_srcdir/torture.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:500"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:500"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:500: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:500"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/torture.at:500: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:500"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/torture.at:500: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "torture.at:500"
( $at_check_trace; bison -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/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:500: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:500"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:500: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:500"
( $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/torture.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }



# Below the limit of 200.
{ set +x
$as_echo "$at_srcdir/torture.at:503: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:503"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:503: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:503"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }


# Two enlargements: 2 * 2 * 200.
{ set +x
$as_echo "$at_srcdir/torture.at:506: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:506"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:506: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:506"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }


# Fails: beyond the limit of 10,000 (which we don't reach anyway since we
# multiply by two starting at 200 => 5120 is the possible).
{ set +x
$as_echo "$at_srcdir/torture.at:510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/torture.at:510"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:510: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:510"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:510"
$at_failed && at_fn_log_failure
$at_traceon; }




# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define YYSTACK_USE_ALLOCA 0
  static int yylex (void);
  #include <stdio.h>

static void yyerror (const char *msg);
%}
%define api.push-pull both

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static int
yylex (void)
{
  assert (0 <= yylval);
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

/* Return argv[1] as an int. */
static int
get_args (int argc, const char **argv)
{
  int res;
  char *endp;
  assert (argc == 2); (void) argc;
  res = strtol (argv[1], &endp, 10);
  assert (argv[1] != endp);
  assert (0 <= res);
  assert (res <= INT_MAX);
  assert (errno != ERANGE);
  return res;
}

int
main (int argc, const char **argv)
{
  YYSTYPE yylval_init = get_args (argc, argv);
  int status = 0;
  int count;
  yypstate *ps = yypstate_new ();
  yydebug = 1;
  for (count = 0; count < 2; ++count)
    {
      int new_status;
      yylval = yylval_init;
      new_status = yypull_parse (ps);
      if (count == 0)
        status = new_status;
      else
        assert (new_status == status);
    }
  yypstate_delete (ps);
  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
$as_echo "$at_srcdir/torture.at:513: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:513"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:513: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:513"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:513: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:513"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/torture.at:513: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:513"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/torture.at:513: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "torture.at:513"
( $at_check_trace; bison -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/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:513: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "torture.at:513"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.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" "torture.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/torture.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:516"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:516"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.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 stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/torture.at:520"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:520: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "torture.at:520"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$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/torture.at:520"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'existing.at:79' \
  "GNU AWK 3.1.0 Grammar: LALR(1)" "                 " 17
at_xfail=no
(
  $as_echo "378. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type lalr
%error-verbose

%token FUNC_CALL NAME REGEXP
%token ERROR
%token YNUMBER YSTRING
%token RELOP APPEND_OP
%token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
%token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
%token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
%token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
%token LEX_GETLINE LEX_NEXTFILE
%token LEX_IN
%token LEX_AND LEX_OR INCREMENT DECREMENT
%token LEX_BUILTIN LEX_LENGTH

/* Lowest to highest */
%right ASSIGNOP
%right '?' ':'
%left LEX_OR
%left LEX_AND
%left LEX_GETLINE
%nonassoc LEX_IN
%left FUNC_CALL LEX_BUILTIN LEX_LENGTH
%nonassoc ','
%nonassoc MATCHOP
%nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
%left CONCAT_OP
%left YSTRING YNUMBER
%left '+' '-'
%left '*' '/' '%'
%right '!' UNARY
%right '^'
%left INCREMENT DECREMENT
%left '$'
%left '(' ')'


%%


start
        : opt_nls program opt_nls
        ;

program
        : rule
        | program rule
        | error
        | program error
        | /* empty */
        ;

rule
        : LEX_BEGIN {} action
        | LEX_END {}   action
        | LEX_BEGIN statement_term
        | LEX_END statement_term
        | pattern action
        | action
        | pattern statement_term
        | function_prologue function_body
        ;

func_name
        : NAME
        | FUNC_CALL
        | lex_builtin
        ;

lex_builtin
        : LEX_BUILTIN
        | LEX_LENGTH
        ;

function_prologue
        : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
        ;

function_body
        : l_brace statements r_brace opt_semi opt_nls
        | l_brace r_brace opt_semi opt_nls
        ;

pattern
        : exp
        | exp ',' exp
        ;

regexp
        /*
         * In this rule, want_regexp tells yylex that the next thing
         * is a regexp so it should read up to the closing slash.
         */
        : '/' {} REGEXP '/'
        ;

action
        : l_brace statements r_brace opt_semi opt_nls
        | l_brace r_brace opt_semi opt_nls
        ;

statements
        : statement
        | statements statement
        | error
        | statements error
        ;

statement_term
        : nls
        | semi opt_nls
        ;

statement
        : semi opt_nls
        | l_brace r_brace
        | l_brace statements r_brace
        | if_statement
        | LEX_WHILE '(' exp r_paren opt_nls statement
        | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
        | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
        | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
        | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
        | LEX_BREAK statement_term
        | LEX_CONTINUE statement_term
        | print '(' expression_list r_paren output_redir statement_term
        | print opt_rexpression_list output_redir statement_term
        | LEX_NEXT statement_term
        | LEX_NEXTFILE statement_term
        | LEX_EXIT opt_exp statement_term
        | LEX_RETURN {} opt_exp statement_term
        | LEX_DELETE NAME '[' expression_list ']' statement_term
        | LEX_DELETE NAME  statement_term
        | exp statement_term
        ;

print
        : LEX_PRINT
        | LEX_PRINTF
        ;

if_statement
        : LEX_IF '(' exp r_paren opt_nls statement
        | LEX_IF '(' exp r_paren opt_nls statement
             LEX_ELSE opt_nls statement
        ;

nls
        : NEWLINE
        | nls NEWLINE
        ;

opt_nls
        : /* empty */
        | nls
        ;

input_redir
        : /* empty */
        | '<' simp_exp
        ;

output_redir
        : /* empty */
        | '>' exp
        | APPEND_OP exp
        | '|' exp
        | TWOWAYIO exp
        ;

opt_param_list
        : /* empty */
        | param_list
        ;

param_list
        : NAME
        | param_list comma NAME
        | error
        | param_list error
        | param_list comma error
        ;

/* optional expression, as in for loop */
opt_exp
        : /* empty */
        | exp
        ;

opt_rexpression_list
        : /* empty */
        | rexpression_list
        ;

rexpression_list
        : rexp
        | rexpression_list comma rexp
        | error
        | rexpression_list error
        | rexpression_list error rexp
        | rexpression_list comma error
        ;

opt_expression_list
        : /* empty */
        | expression_list
        ;

expression_list
        : exp
        | expression_list comma exp
        | error
        | expression_list error
        | expression_list error exp
        | expression_list comma error
        ;

/* Expressions, not including the comma operator.  */
exp     : variable ASSIGNOP {} exp
        | '(' expression_list r_paren LEX_IN NAME
        | exp '|' LEX_GETLINE opt_variable
        | exp TWOWAYIO LEX_GETLINE opt_variable
        | LEX_GETLINE opt_variable input_redir
        | exp LEX_AND exp
        | exp LEX_OR exp
        | exp MATCHOP exp
        | regexp
        | '!' regexp %prec UNARY
        | exp LEX_IN NAME
        | exp RELOP exp
        | exp '<' exp
        | exp '>' exp
        | exp '?' exp ':' exp
        | simp_exp
        | exp simp_exp %prec CONCAT_OP
        ;

rexp
        : variable ASSIGNOP {} rexp
        | rexp LEX_AND rexp
        | rexp LEX_OR rexp
        | LEX_GETLINE opt_variable input_redir
        | regexp
        | '!' regexp %prec UNARY
        | rexp MATCHOP rexp
        | rexp LEX_IN NAME
        | rexp RELOP rexp
        | rexp '?' rexp ':' rexp
        | simp_exp
        | rexp simp_exp %prec CONCAT_OP
        ;

simp_exp
        : non_post_simp_exp
        /* Binary operators in order of decreasing precedence.  */
        | simp_exp '^' simp_exp
        | simp_exp '*' simp_exp
        | simp_exp '/' simp_exp
        | simp_exp '%' simp_exp
        | simp_exp '+' simp_exp
        | simp_exp '-' simp_exp
        | variable INCREMENT
        | variable DECREMENT
        ;

non_post_simp_exp
        : '!' simp_exp %prec UNARY
        | '(' exp r_paren
        | LEX_BUILTIN
          '(' opt_expression_list r_paren
        | LEX_LENGTH '(' opt_expression_list r_paren
        | LEX_LENGTH
        | FUNC_CALL '(' opt_expression_list r_paren
        | variable
        | INCREMENT variable
        | DECREMENT variable
        | YNUMBER
        | YSTRING
        | '-' simp_exp    %prec UNARY
        | '+' simp_exp    %prec UNARY
        ;

opt_variable
        : /* empty */
        | variable
        ;

variable
        : NAME
        | NAME '[' expression_list ']'
        | '$' non_post_simp_exp
        ;

l_brace
        : '{' opt_nls
        ;

r_brace
        : '}' opt_nls
        ;

r_paren
        : ')'
        ;

opt_semi
        : /* empty */
        | semi
        ;

semi
        : ';'
        ;

comma   : ',' opt_nls
        ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:79: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule]
input.y:169.8: warning: empty rule without %empty [-Wempty-rule]
input.y:174.12: warning: empty rule without %empty [-Wempty-rule]
input.y:179.13: warning: empty rule without %empty [-Wempty-rule]
input.y:187.15: warning: empty rule without %empty [-Wempty-rule]
input.y:201.8: warning: empty rule without %empty [-Wempty-rule]
input.y:206.21: warning: empty rule without %empty [-Wempty-rule]
input.y:220.20: warning: empty rule without %empty [-Wempty-rule]
input.y:299.13: warning: empty rule without %empty [-Wempty-rule]
input.y:322.9: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]
input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence]
input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:51.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/existing.at:79"
$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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:66.10: warning: empty rule without %empty [-Wempty-rule]
input.y:169.8: warning: empty rule without %empty [-Wempty-rule]
input.y:174.12: warning: empty rule without %empty [-Wempty-rule]
input.y:179.13: warning: empty rule without %empty [-Wempty-rule]
input.y:187.15: warning: empty rule without %empty [-Wempty-rule]
input.y:201.8: warning: empty rule without %empty [-Wempty-rule]
input.y:206.21: warning: empty rule without %empty [-Wempty-rule]
input.y:220.20: warning: empty rule without %empty [-Wempty-rule]
input.y:299.13: warning: empty rule without %empty [-Wempty-rule]
input.y:322.9: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]
input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence]
input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:79: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "319
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; diff -u /dev/null /dev/null || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79"
( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input-lalr.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:79: bison -fno-caret --report=all input-lalr.y"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; bison -fno-caret --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\
           | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
( $at_check_trace; diff -u input-lalr.output input.output \
           | sed -n '/^@@/,$p' | sed 's/^ $//'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '*', expecting NEWLINE or '{' or ';'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:79' \
  "GNU AWK 3.1.0 Grammar: IELR(1)" "                 " 17
at_xfail=no
(
  $as_echo "379. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type ielr
%error-verbose

%token FUNC_CALL NAME REGEXP
%token ERROR
%token YNUMBER YSTRING
%token RELOP APPEND_OP
%token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
%token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
%token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
%token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
%token LEX_GETLINE LEX_NEXTFILE
%token LEX_IN
%token LEX_AND LEX_OR INCREMENT DECREMENT
%token LEX_BUILTIN LEX_LENGTH

/* Lowest to highest */
%right ASSIGNOP
%right '?' ':'
%left LEX_OR
%left LEX_AND
%left LEX_GETLINE
%nonassoc LEX_IN
%left FUNC_CALL LEX_BUILTIN LEX_LENGTH
%nonassoc ','
%nonassoc MATCHOP
%nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
%left CONCAT_OP
%left YSTRING YNUMBER
%left '+' '-'
%left '*' '/' '%'
%right '!' UNARY
%right '^'
%left INCREMENT DECREMENT
%left '$'
%left '(' ')'


%%


start
        : opt_nls program opt_nls
        ;

program
        : rule
        | program rule
        | error
        | program error
        | /* empty */
        ;

rule
        : LEX_BEGIN {} action
        | LEX_END {}   action
        | LEX_BEGIN statement_term
        | LEX_END statement_term
        | pattern action
        | action
        | pattern statement_term
        | function_prologue function_body
        ;

func_name
        : NAME
        | FUNC_CALL
        | lex_builtin
        ;

lex_builtin
        : LEX_BUILTIN
        | LEX_LENGTH
        ;

function_prologue
        : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
        ;

function_body
        : l_brace statements r_brace opt_semi opt_nls
        | l_brace r_brace opt_semi opt_nls
        ;

pattern
        : exp
        | exp ',' exp
        ;

regexp
        /*
         * In this rule, want_regexp tells yylex that the next thing
         * is a regexp so it should read up to the closing slash.
         */
        : '/' {} REGEXP '/'
        ;

action
        : l_brace statements r_brace opt_semi opt_nls
        | l_brace r_brace opt_semi opt_nls
        ;

statements
        : statement
        | statements statement
        | error
        | statements error
        ;

statement_term
        : nls
        | semi opt_nls
        ;

statement
        : semi opt_nls
        | l_brace r_brace
        | l_brace statements r_brace
        | if_statement
        | LEX_WHILE '(' exp r_paren opt_nls statement
        | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
        | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
        | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
        | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
        | LEX_BREAK statement_term
        | LEX_CONTINUE statement_term
        | print '(' expression_list r_paren output_redir statement_term
        | print opt_rexpression_list output_redir statement_term
        | LEX_NEXT statement_term
        | LEX_NEXTFILE statement_term
        | LEX_EXIT opt_exp statement_term
        | LEX_RETURN {} opt_exp statement_term
        | LEX_DELETE NAME '[' expression_list ']' statement_term
        | LEX_DELETE NAME  statement_term
        | exp statement_term
        ;

print
        : LEX_PRINT
        | LEX_PRINTF
        ;

if_statement
        : LEX_IF '(' exp r_paren opt_nls statement
        | LEX_IF '(' exp r_paren opt_nls statement
             LEX_ELSE opt_nls statement
        ;

nls
        : NEWLINE
        | nls NEWLINE
        ;

opt_nls
        : /* empty */
        | nls
        ;

input_redir
        : /* empty */
        | '<' simp_exp
        ;

output_redir
        : /* empty */
        | '>' exp
        | APPEND_OP exp
        | '|' exp
        | TWOWAYIO exp
        ;

opt_param_list
        : /* empty */
        | param_list
        ;

param_list
        : NAME
        | param_list comma NAME
        | error
        | param_list error
        | param_list comma error
        ;

/* optional expression, as in for loop */
opt_exp
        : /* empty */
        | exp
        ;

opt_rexpression_list
        : /* empty */
        | rexpression_list
        ;

rexpression_list
        : rexp
        | rexpression_list comma rexp
        | error
        | rexpression_list error
        | rexpression_list error rexp
        | rexpression_list comma error
        ;

opt_expression_list
        : /* empty */
        | expression_list
        ;

expression_list
        : exp
        | expression_list comma exp
        | error
        | expression_list error
        | expression_list error exp
        | expression_list comma error
        ;

/* Expressions, not including the comma operator.  */
exp     : variable ASSIGNOP {} exp
        | '(' expression_list r_paren LEX_IN NAME
        | exp '|' LEX_GETLINE opt_variable
        | exp TWOWAYIO LEX_GETLINE opt_variable
        | LEX_GETLINE opt_variable input_redir
        | exp LEX_AND exp
        | exp LEX_OR exp
        | exp MATCHOP exp
        | regexp
        | '!' regexp %prec UNARY
        | exp LEX_IN NAME
        | exp RELOP exp
        | exp '<' exp
        | exp '>' exp
        | exp '?' exp ':' exp
        | simp_exp
        | exp simp_exp %prec CONCAT_OP
        ;

rexp
        : variable ASSIGNOP {} rexp
        | rexp LEX_AND rexp
        | rexp LEX_OR rexp
        | LEX_GETLINE opt_variable input_redir
        | regexp
        | '!' regexp %prec UNARY
        | rexp MATCHOP rexp
        | rexp LEX_IN NAME
        | rexp RELOP rexp
        | rexp '?' rexp ':' rexp
        | simp_exp
        | rexp simp_exp %prec CONCAT_OP
        ;

simp_exp
        : non_post_simp_exp
        /* Binary operators in order of decreasing precedence.  */
        | simp_exp '^' simp_exp
        | simp_exp '*' simp_exp
        | simp_exp '/' simp_exp
        | simp_exp '%' simp_exp
        | simp_exp '+' simp_exp
        | simp_exp '-' simp_exp
        | variable INCREMENT
        | variable DECREMENT
        ;

non_post_simp_exp
        : '!' simp_exp %prec UNARY
        | '(' exp r_paren
        | LEX_BUILTIN
          '(' opt_expression_list r_paren
        | LEX_LENGTH '(' opt_expression_list r_paren
        | LEX_LENGTH
        | FUNC_CALL '(' opt_expression_list r_paren
        | variable
        | INCREMENT variable
        | DECREMENT variable
        | YNUMBER
        | YSTRING
        | '-' simp_exp    %prec UNARY
        | '+' simp_exp    %prec UNARY
        ;

opt_variable
        : /* empty */
        | variable
        ;

variable
        : NAME
        | NAME '[' expression_list ']'
        | '$' non_post_simp_exp
        ;

l_brace
        : '{' opt_nls
        ;

r_brace
        : '}' opt_nls
        ;

r_paren
        : ')'
        ;

opt_semi
        : /* empty */
        | semi
        ;

semi
        : ';'
        ;

comma   : ',' opt_nls
        ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:79: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule]
input.y:169.8: warning: empty rule without %empty [-Wempty-rule]
input.y:174.12: warning: empty rule without %empty [-Wempty-rule]
input.y:179.13: warning: empty rule without %empty [-Wempty-rule]
input.y:187.15: warning: empty rule without %empty [-Wempty-rule]
input.y:201.8: warning: empty rule without %empty [-Wempty-rule]
input.y:206.21: warning: empty rule without %empty [-Wempty-rule]
input.y:220.20: warning: empty rule without %empty [-Wempty-rule]
input.y:299.13: warning: empty rule without %empty [-Wempty-rule]
input.y:322.9: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]
input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence]
input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:51.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/existing.at:79"
$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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:66.10: warning: empty rule without %empty [-Wempty-rule]
input.y:169.8: warning: empty rule without %empty [-Wempty-rule]
input.y:174.12: warning: empty rule without %empty [-Wempty-rule]
input.y:179.13: warning: empty rule without %empty [-Wempty-rule]
input.y:187.15: warning: empty rule without %empty [-Wempty-rule]
input.y:201.8: warning: empty rule without %empty [-Wempty-rule]
input.y:206.21: warning: empty rule without %empty [-Wempty-rule]
input.y:220.20: warning: empty rule without %empty [-Wempty-rule]
input.y:299.13: warning: empty rule without %empty [-Wempty-rule]
input.y:322.9: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]
input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence]
input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:79: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "328
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79: diff -u /dev/null /dev/null || exit 77"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; diff -u /dev/null /dev/null || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:79"
( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input-lalr.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:79: bison -fno-caret --report=all input-lalr.y"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; bison -fno-caret --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79: diff -u input-lalr.output input.output \\
           | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:79"
( $at_check_trace; diff -u input-lalr.output input.output \
           | sed -n '/^@@/,$p' | sed 's/^ $//'
) >>"$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"; $as_echo "@@ -712,7 +712,7 @@
   156         | . '\$' non_post_simp_exp

     NAME  shift, and go to state 9
-    '\$'   shift, and go to state 24
+    '\$'   shift, and go to state 320

     NAME      [reduce using rule 152 (opt_variable)]
     '\$'       [reduce using rule 152 (opt_variable)]
@@ -5379,7 +5379,7 @@
   156         | . '\$' non_post_simp_exp

     NAME  shift, and go to state 9
-    '\$'   shift, and go to state 24
+    '\$'   shift, and go to state 320

     NAME      [reduce using rule 152 (opt_variable)]
     '\$'       [reduce using rule 152 (opt_variable)]
@@ -5399,7 +5399,7 @@
   156         | . '\$' non_post_simp_exp

     NAME  shift, and go to state 9
-    '\$'   shift, and go to state 24
+    '\$'   shift, and go to state 320

     NAME      [reduce using rule 152 (opt_variable)]
     '\$'       [reduce using rule 152 (opt_variable)]
@@ -6214,7 +6214,7 @@
   156         | . '\$' non_post_simp_exp

     NAME  shift, and go to state 9
-    '\$'   shift, and go to state 24
+    '\$'   shift, and go to state 320

     NAME      [reduce using rule 152 (opt_variable)]
     '\$'       [reduce using rule 152 (opt_variable)]
@@ -11099,3 +11099,274 @@
    45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement .

     \$default  reduce using rule 45 (statement)
+
+
+State 320
+
+  139 non_post_simp_exp: . '!' simp_exp
+  140                  | . '(' exp r_paren
+  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
+  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
+  143                  | . LEX_LENGTH
+  144                  | . FUNC_CALL '(' opt_expression_list r_paren
+  145                  | . variable
+  146                  | . INCREMENT variable
+  147                  | . DECREMENT variable
+  148                  | . YNUMBER
+  149                  | . YSTRING
+  150                  | . '-' simp_exp
+  151                  | . '+' simp_exp
+  154 variable: . NAME
+  155         | . NAME '[' expression_list ']'
+  156         | . '\$' non_post_simp_exp
+  156         | '\$' . non_post_simp_exp
+
+    FUNC_CALL    shift, and go to state 8
+    NAME         shift, and go to state 9
+    YNUMBER      shift, and go to state 10
+    YSTRING      shift, and go to state 11
+    INCREMENT    shift, and go to state 321
+    DECREMENT    shift, and go to state 322
+    LEX_BUILTIN  shift, and go to state 18
+    LEX_LENGTH   shift, and go to state 19
+    '+'          shift, and go to state 323
+    '-'          shift, and go to state 324
+    '!'          shift, and go to state 325
+    '\$'          shift, and go to state 320
+    '('          shift, and go to state 55
+
+    non_post_simp_exp  go to state 62
+    variable           go to state 63
+
+
+State 321
+
+  146 non_post_simp_exp: INCREMENT . variable
+  154 variable: . NAME
+  155         | . NAME '[' expression_list ']'
+  156         | . '\$' non_post_simp_exp
+
+    NAME  shift, and go to state 9
+    '\$'   shift, and go to state 320
+
+    variable  go to state 50
+
+
+State 322
+
+  147 non_post_simp_exp: DECREMENT . variable
+  154 variable: . NAME
+  155         | . NAME '[' expression_list ']'
+  156         | . '\$' non_post_simp_exp
+
+    NAME  shift, and go to state 9
+    '\$'   shift, and go to state 320
+
+    variable  go to state 51
+
+
+State 323
+
+  130 simp_exp: . non_post_simp_exp
+  131         | . simp_exp '^' simp_exp
+  132         | . simp_exp '*' simp_exp
+  133         | . simp_exp '/' simp_exp
+  134         | . simp_exp '%' simp_exp
+  135         | . simp_exp '+' simp_exp
+  136         | . simp_exp '-' simp_exp
+  137         | . variable INCREMENT
+  138         | . variable DECREMENT
+  139 non_post_simp_exp: . '!' simp_exp
+  140                  | . '(' exp r_paren
+  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
+  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
+  143                  | . LEX_LENGTH
+  144                  | . FUNC_CALL '(' opt_expression_list r_paren
+  145                  | . variable
+  146                  | . INCREMENT variable
+  147                  | . DECREMENT variable
+  148                  | . YNUMBER
+  149                  | . YSTRING
+  150                  | . '-' simp_exp
+  151                  | . '+' simp_exp
+  151                  | '+' . simp_exp
+  154 variable: . NAME
+  155         | . NAME '[' expression_list ']'
+  156         | . '\$' non_post_simp_exp
+
+    FUNC_CALL    shift, and go to state 8
+    NAME         shift, and go to state 9
+    YNUMBER      shift, and go to state 10
+    YSTRING      shift, and go to state 11
+    INCREMENT    shift, and go to state 16
+    DECREMENT    shift, and go to state 17
+    LEX_BUILTIN  shift, and go to state 18
+    LEX_LENGTH   shift, and go to state 19
+    '+'          shift, and go to state 20
+    '-'          shift, and go to state 21
+    '!'          shift, and go to state 54
+    '\$'          shift, and go to state 24
+    '('          shift, and go to state 55
+
+    simp_exp           go to state 326
+    non_post_simp_exp  go to state 35
+    variable           go to state 57
+
+
+State 324
+
+  130 simp_exp: . non_post_simp_exp
+  131         | . simp_exp '^' simp_exp
+  132         | . simp_exp '*' simp_exp
+  133         | . simp_exp '/' simp_exp
+  134         | . simp_exp '%' simp_exp
+  135         | . simp_exp '+' simp_exp
+  136         | . simp_exp '-' simp_exp
+  137         | . variable INCREMENT
+  138         | . variable DECREMENT
+  139 non_post_simp_exp: . '!' simp_exp
+  140                  | . '(' exp r_paren
+  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
+  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
+  143                  | . LEX_LENGTH
+  144                  | . FUNC_CALL '(' opt_expression_list r_paren
+  145                  | . variable
+  146                  | . INCREMENT variable
+  147                  | . DECREMENT variable
+  148                  | . YNUMBER
+  149                  | . YSTRING
+  150                  | . '-' simp_exp
+  150                  | '-' . simp_exp
+  151                  | . '+' simp_exp
+  154 variable: . NAME
+  155         | . NAME '[' expression_list ']'
+  156         | . '\$' non_post_simp_exp
+
+    FUNC_CALL    shift, and go to state 8
+    NAME         shift, and go to state 9
+    YNUMBER      shift, and go to state 10
+    YSTRING      shift, and go to state 11
+    INCREMENT    shift, and go to state 16
+    DECREMENT    shift, and go to state 17
+    LEX_BUILTIN  shift, and go to state 18
+    LEX_LENGTH   shift, and go to state 19
+    '+'          shift, and go to state 20
+    '-'          shift, and go to state 21
+    '!'          shift, and go to state 54
+    '\$'          shift, and go to state 24
+    '('          shift, and go to state 55
+
+    simp_exp           go to state 327
+    non_post_simp_exp  go to state 35
+    variable           go to state 57
+
+
+State 325
+
+  130 simp_exp: . non_post_simp_exp
+  131         | . simp_exp '^' simp_exp
+  132         | . simp_exp '*' simp_exp
+  133         | . simp_exp '/' simp_exp
+  134         | . simp_exp '%' simp_exp
+  135         | . simp_exp '+' simp_exp
+  136         | . simp_exp '-' simp_exp
+  137         | . variable INCREMENT
+  138         | . variable DECREMENT
+  139 non_post_simp_exp: . '!' simp_exp
+  139                  | '!' . simp_exp
+  140                  | . '(' exp r_paren
+  141                  | . LEX_BUILTIN '(' opt_expression_list r_paren
+  142                  | . LEX_LENGTH '(' opt_expression_list r_paren
+  143                  | . LEX_LENGTH
+  144                  | . FUNC_CALL '(' opt_expression_list r_paren
+  145                  | . variable
+  146                  | . INCREMENT variable
+  147                  | . DECREMENT variable
+  148                  | . YNUMBER
+  149                  | . YSTRING
+  150                  | . '-' simp_exp
+  151                  | . '+' simp_exp
+  154 variable: . NAME
+  155         | . NAME '[' expression_list ']'
+  156         | . '\$' non_post_simp_exp
+
+    FUNC_CALL    shift, and go to state 8
+    NAME         shift, and go to state 9
+    YNUMBER      shift, and go to state 10
+    YSTRING      shift, and go to state 11
+    INCREMENT    shift, and go to state 16
+    DECREMENT    shift, and go to state 17
+    LEX_BUILTIN  shift, and go to state 18
+    LEX_LENGTH   shift, and go to state 19
+    '+'          shift, and go to state 20
+    '-'          shift, and go to state 21
+    '!'          shift, and go to state 54
+    '\$'          shift, and go to state 24
+    '('          shift, and go to state 55
+
+    simp_exp           go to state 328
+    non_post_simp_exp  go to state 35
+    variable           go to state 57
+
+
+State 326
+
+  131 simp_exp: simp_exp . '^' simp_exp
+  132         | simp_exp . '*' simp_exp
+  133         | simp_exp . '/' simp_exp
+  134         | simp_exp . '%' simp_exp
+  135         | simp_exp . '+' simp_exp
+  136         | simp_exp . '-' simp_exp
+  151 non_post_simp_exp: '+' simp_exp .  [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';']
+
+    '*'  shift, and go to state 89
+    '/'  shift, and go to state 90
+    '%'  shift, and go to state 91
+    '^'  shift, and go to state 92
+
+    \$default  reduce using rule 151 (non_post_simp_exp)
+
+    Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY).
+    Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY).
+
+
+State 327
+
+  131 simp_exp: simp_exp . '^' simp_exp
+  132         | simp_exp . '*' simp_exp
+  133         | simp_exp . '/' simp_exp
+  134         | simp_exp . '%' simp_exp
+  135         | simp_exp . '+' simp_exp
+  136         | simp_exp . '-' simp_exp
+  150 non_post_simp_exp: '-' simp_exp .  [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';']
+
+    '*'  shift, and go to state 89
+    '/'  shift, and go to state 90
+    '%'  shift, and go to state 91
+    '^'  shift, and go to state 92
+
+    \$default  reduce using rule 150 (non_post_simp_exp)
+
+    Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY).
+    Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY).
+
+
+State 328
+
+  131 simp_exp: simp_exp . '^' simp_exp
+  132         | simp_exp . '*' simp_exp
+  133         | simp_exp . '/' simp_exp
+  134         | simp_exp . '%' simp_exp
+  135         | simp_exp . '+' simp_exp
+  136         | simp_exp . '-' simp_exp
+  139 non_post_simp_exp: '!' simp_exp .  [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '\$', '(', ')', ']', '{', ';']
+
+    '*'  shift, and go to state 89
+    '/'  shift, and go to state 90
+    '%'  shift, and go to state 91
+    '^'  shift, and go to state 92
+
+    \$default  reduce using rule 139 (non_post_simp_exp)
+
+    Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY).
+    Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY).
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; 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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:79' \
  "GNU AWK 3.1.0 Grammar: Canonical LR(1)" "         " 17
at_xfail=no
(
  $as_echo "380. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type canonical-lr
%error-verbose

%token FUNC_CALL NAME REGEXP
%token ERROR
%token YNUMBER YSTRING
%token RELOP APPEND_OP
%token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
%token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
%token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
%token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
%token LEX_GETLINE LEX_NEXTFILE
%token LEX_IN
%token LEX_AND LEX_OR INCREMENT DECREMENT
%token LEX_BUILTIN LEX_LENGTH

/* Lowest to highest */
%right ASSIGNOP
%right '?' ':'
%left LEX_OR
%left LEX_AND
%left LEX_GETLINE
%nonassoc LEX_IN
%left FUNC_CALL LEX_BUILTIN LEX_LENGTH
%nonassoc ','
%nonassoc MATCHOP
%nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
%left CONCAT_OP
%left YSTRING YNUMBER
%left '+' '-'
%left '*' '/' '%'
%right '!' UNARY
%right '^'
%left INCREMENT DECREMENT
%left '$'
%left '(' ')'


%%


start
        : opt_nls program opt_nls
        ;

program
        : rule
        | program rule
        | error
        | program error
        | /* empty */
        ;

rule
        : LEX_BEGIN {} action
        | LEX_END {}   action
        | LEX_BEGIN statement_term
        | LEX_END statement_term
        | pattern action
        | action
        | pattern statement_term
        | function_prologue function_body
        ;

func_name
        : NAME
        | FUNC_CALL
        | lex_builtin
        ;

lex_builtin
        : LEX_BUILTIN
        | LEX_LENGTH
        ;

function_prologue
        : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
        ;

function_body
        : l_brace statements r_brace opt_semi opt_nls
        | l_brace r_brace opt_semi opt_nls
        ;

pattern
        : exp
        | exp ',' exp
        ;

regexp
        /*
         * In this rule, want_regexp tells yylex that the next thing
         * is a regexp so it should read up to the closing slash.
         */
        : '/' {} REGEXP '/'
        ;

action
        : l_brace statements r_brace opt_semi opt_nls
        | l_brace r_brace opt_semi opt_nls
        ;

statements
        : statement
        | statements statement
        | error
        | statements error
        ;

statement_term
        : nls
        | semi opt_nls
        ;

statement
        : semi opt_nls
        | l_brace r_brace
        | l_brace statements r_brace
        | if_statement
        | LEX_WHILE '(' exp r_paren opt_nls statement
        | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
        | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
        | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
        | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
        | LEX_BREAK statement_term
        | LEX_CONTINUE statement_term
        | print '(' expression_list r_paren output_redir statement_term
        | print opt_rexpression_list output_redir statement_term
        | LEX_NEXT statement_term
        | LEX_NEXTFILE statement_term
        | LEX_EXIT opt_exp statement_term
        | LEX_RETURN {} opt_exp statement_term
        | LEX_DELETE NAME '[' expression_list ']' statement_term
        | LEX_DELETE NAME  statement_term
        | exp statement_term
        ;

print
        : LEX_PRINT
        | LEX_PRINTF
        ;

if_statement
        : LEX_IF '(' exp r_paren opt_nls statement
        | LEX_IF '(' exp r_paren opt_nls statement
             LEX_ELSE opt_nls statement
        ;

nls
        : NEWLINE
        | nls NEWLINE
        ;

opt_nls
        : /* empty */
        | nls
        ;

input_redir
        : /* empty */
        | '<' simp_exp
        ;

output_redir
        : /* empty */
        | '>' exp
        | APPEND_OP exp
        | '|' exp
        | TWOWAYIO exp
        ;

opt_param_list
        : /* empty */
        | param_list
        ;

param_list
        : NAME
        | param_list comma NAME
        | error
        | param_list error
        | param_list comma error
        ;

/* optional expression, as in for loop */
opt_exp
        : /* empty */
        | exp
        ;

opt_rexpression_list
        : /* empty */
        | rexpression_list
        ;

rexpression_list
        : rexp
        | rexpression_list comma rexp
        | error
        | rexpression_list error
        | rexpression_list error rexp
        | rexpression_list comma error
        ;

opt_expression_list
        : /* empty */
        | expression_list
        ;

expression_list
        : exp
        | expression_list comma exp
        | error
        | expression_list error
        | expression_list error exp
        | expression_list comma error
        ;

/* Expressions, not including the comma operator.  */
exp     : variable ASSIGNOP {} exp
        | '(' expression_list r_paren LEX_IN NAME
        | exp '|' LEX_GETLINE opt_variable
        | exp TWOWAYIO LEX_GETLINE opt_variable
        | LEX_GETLINE opt_variable input_redir
        | exp LEX_AND exp
        | exp LEX_OR exp
        | exp MATCHOP exp
        | regexp
        | '!' regexp %prec UNARY
        | exp LEX_IN NAME
        | exp RELOP exp
        | exp '<' exp
        | exp '>' exp
        | exp '?' exp ':' exp
        | simp_exp
        | exp simp_exp %prec CONCAT_OP
        ;

rexp
        : variable ASSIGNOP {} rexp
        | rexp LEX_AND rexp
        | rexp LEX_OR rexp
        | LEX_GETLINE opt_variable input_redir
        | regexp
        | '!' regexp %prec UNARY
        | rexp MATCHOP rexp
        | rexp LEX_IN NAME
        | rexp RELOP rexp
        | rexp '?' rexp ':' rexp
        | simp_exp
        | rexp simp_exp %prec CONCAT_OP
        ;

simp_exp
        : non_post_simp_exp
        /* Binary operators in order of decreasing precedence.  */
        | simp_exp '^' simp_exp
        | simp_exp '*' simp_exp
        | simp_exp '/' simp_exp
        | simp_exp '%' simp_exp
        | simp_exp '+' simp_exp
        | simp_exp '-' simp_exp
        | variable INCREMENT
        | variable DECREMENT
        ;

non_post_simp_exp
        : '!' simp_exp %prec UNARY
        | '(' exp r_paren
        | LEX_BUILTIN
          '(' opt_expression_list r_paren
        | LEX_LENGTH '(' opt_expression_list r_paren
        | LEX_LENGTH
        | FUNC_CALL '(' opt_expression_list r_paren
        | variable
        | INCREMENT variable
        | DECREMENT variable
        | YNUMBER
        | YSTRING
        | '-' simp_exp    %prec UNARY
        | '+' simp_exp    %prec UNARY
        ;

opt_variable
        : /* empty */
        | variable
        ;

variable
        : NAME
        | NAME '[' expression_list ']'
        | '$' non_post_simp_exp
        ;

l_brace
        : '{' opt_nls
        ;

r_brace
        : '}' opt_nls
        ;

r_paren
        : ')'
        ;

opt_semi
        : /* empty */
        | semi
        ;

semi
        : ';'
        ;

comma   : ',' opt_nls
        ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 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.

{ set +x
$as_echo "$at_srcdir/existing.at:79: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule]
input.y:169.8: warning: empty rule without %empty [-Wempty-rule]
input.y:174.12: warning: empty rule without %empty [-Wempty-rule]
input.y:179.13: warning: empty rule without %empty [-Wempty-rule]
input.y:187.15: warning: empty rule without %empty [-Wempty-rule]
input.y:201.8: warning: empty rule without %empty [-Wempty-rule]
input.y:206.21: warning: empty rule without %empty [-Wempty-rule]
input.y:220.20: warning: empty rule without %empty [-Wempty-rule]
input.y:299.13: warning: empty rule without %empty [-Wempty-rule]
input.y:322.9: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]
input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence]
input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:51.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/existing.at:79"
$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
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:66.10: warning: empty rule without %empty [-Wempty-rule]
input.y:169.8: warning: empty rule without %empty [-Wempty-rule]
input.y:174.12: warning: empty rule without %empty [-Wempty-rule]
input.y:179.13: warning: empty rule without %empty [-Wempty-rule]
input.y:187.15: warning: empty rule without %empty [-Wempty-rule]
input.y:201.8: warning: empty rule without %empty [-Wempty-rule]
input.y:206.21: warning: empty rule without %empty [-Wempty-rule]
input.y:220.20: warning: empty rule without %empty [-Wempty-rule]
input.y:299.13: warning: empty rule without %empty [-Wempty-rule]
input.y:322.9: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]
input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence]
input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence]
input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence]
input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence]
input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence]
input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence]
input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence]
input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence]
input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence]
input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence]
input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence]
input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:79: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:79: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:79"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:79: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:79"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "2358
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$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 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
{ set +x
$as_echo "$at_srcdir/existing.at:79: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:79"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:79: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:79:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:79"
( $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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:79: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:79"
( $at_check_trace; 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/existing.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:811' \
  "GNU Cim Grammar: LALR(1)" "                       " 17
at_xfail=no
(
  $as_echo "381. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type lalr

%token
        HACTIVATE HAFTER /*HAND*/ HARRAY HAT
        HBEFORE HBEGIN HBOOLEAN
        HCHARACTER HCLASS /*HCOMMENT*/ HCONC
        HDELAY HDO
        HELSE HEND HEQ /*HEQV*/ HEXTERNAL
        HFOR
        HGE HGO HGOTO HGT
        HHIDDEN
        HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
        HLABEL HLE HLONG HLT
        HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
        /*HOR*/ HOTHERWISE
        HPRIOR HPROCEDURE HPROTECTED
        HQUA
        HREACTIVATE HREAL HREF
        HSHORT HSTEP HSWITCH
        HTEXT HTHEN HTHIS HTO
        HUNTIL
        HVALUE HVAR HVIRTUAL
        HWHEN HWHILE

        HASSIGNVALUE HASSIGNREF
        /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
        HBEGPAR HENDPAR
        HEQR HNER
        HADD HSUB HMUL HDIV HINTDIV HEXP
        HDOTDOTDOT

%token HIDENTIFIER
%token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
%token HREALKONST
%token HTEXTKONST


%right HASSIGN
%left   HORELSE
%left   HANDTHEN
%left   HEQV
%left   HIMP
%left   HOR
%left   HAND

%left   HNOT

%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR

%left   HCONC

%left HTERMOPERATOR
%left UNEAR
%left HFACTOROPERATOR
%left         HPRIMARYOPERATOR

%left   HQUA

%left   HDOT

%start  MAIN_MODULE


%%


/* GRAMATIKK FOR PROGRAM MODULES */
MAIN_MODULE     :       {}
                        MODULS
                |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
                ;
EXT_DECLARATION :       HEXTERNAL
                        MBEE_TYPE
                        HPROCEDURE
                                {}
                        EXT_LIST
                |
                        HEXTERNAL
                        HIDENTIFIER
                        HPROCEDURE
                                {}
                        HIDENTIFIER {}
                        EXTERNAL_KIND_ITEM
                |       HEXTERNAL
                        HCLASS
                                {}
                        EXT_LIST

                ;
EXTERNAL_KIND_ITEM:     EXT_IDENT
                        HOBJRELOPERATOR
                                {}
                        MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                {}
                        HEADING EMPTY_BLOCK
                                {}
/*              |
                        EXT_IDENT
                                {}
                        MBEE_REST_EXT_LIST
                ;
MBEE_REST_EXT_LIST:     /* EMPTY
                |       HPAREXPSEPARATOR EXT_KIND_LIST
                ;
EXT_KIND_LIST   :       EXT_KIND_ITEM
                |       EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
                ;
EXT_KIND_ITEM   :       HIDENTIFIER
                        EXT_IDENT
                                {}*/
                ;
EMPTY_BLOCK     :       /*EMPT*/
                |       HBEGIN HEND
                ;
EXT_LIST        :       EXT_ITEM
                |       EXT_LIST HPAREXPSEPARATOR EXT_ITEM
                ;
EXT_ITEM        :       HIDENTIFIER
                        EXT_IDENT
                ;
EXT_IDENT       :       /* EMPTY */
                |       HVALRELOPERATOR {}
                        HTEXTKONST
                ;
/* GRAMATIKK FOR TYPER */
NO_TYPE         :       /*EMPT*/
                ;
MBEE_TYPE       :       NO_TYPE
                |       TYPE
                ;
TYPE            :       HREF HBEGPAR
                        HIDENTIFIER
                                {}
                        HENDPAR
                |       HTEXT
                |       HBOOLEAN
                |       HCHARACTER
                |       HSHORT HINTEGER
                |       HINTEGER
                |       HREAL
                |       HLONG HREAL
                ;

/* GRAMATIKK FOR DEL AV SETNINGER */
MBEE_ELSE_PART  :       /*EMPT*/
/*              |       HELSE
                        HIF
                        EXPRESSION
                        HTHEN   {}
                        BLOCK   {}
                        MBEE_ELSE_PART          {}*/
                |       HELSE   {}
                        BLOCK
                ;
FOR_LIST        :       FOR_LIST_ELEMENT
                |       FOR_LIST_ELEMENT
                        HPAREXPSEPARATOR
                        FOR_LIST
                ;
FOR_LIST_ELEMENT:       EXPRESSION
                        MBEE_F_L_EL_R_PT
                ;
MBEE_F_L_EL_R_PT:       /*EMPT*/
                |       HWHILE
                        EXPRESSION
                |       HSTEP
                        EXPRESSION
                        HUNTIL
                        EXPRESSION
                ;
GOTO            :       HGO
                        HTO
                |       HGOTO
                ;
CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
                |       HDO   {}
                        BLOCK
                ;
WHEN_CLAUSE_LIST:       HWHEN
                        HIDENTIFIER
                        HDO    {}
                        BLOCK
                |       WHEN_CLAUSE_LIST
                        HWHEN
                        HIDENTIFIER
                        HDO    {}
                        BLOCK
                ;
MBEE_OTWI_CLAUS :       /*EMPT*/
                |       HOTHERWISE {}

                        BLOCK
                ;
ACTIVATOR       :       HACTIVATE
                |       HREACTIVATE
                ;
SCHEDULE        :       /*EMPT*/
                |       ATDELAY EXPRESSION      {}
                        PRIOR
                |       BEFOREAFTER             {}
                        EXPRESSION
                ;
ATDELAY         :       HAT
                |       HDELAY
                ;
BEFOREAFTER     :       HBEFORE
                |       HAFTER
                ;
PRIOR           :       /*EMPT*/
                |       HPRIOR
                ;
/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
MODULSTATEMENT  :       HWHILE
                        EXPRESSION
                        HDO     {}
                        BLOCK
                |       HIF
                        EXPRESSION
                        HTHEN   {}
                        BLOCK   {}
                        MBEE_ELSE_PART
                |       HFOR
                        HIDENTIFIER
                        HASSIGN {}
                        FOR_LIST
                        HDO     {}
                        BLOCK
                |       GOTO
                        EXPRESSION
                |       HINSPECT
                        EXPRESSION              {}
                        CONN_STATE_R_PT
                                {}
                        MBEE_OTWI_CLAUS
                |       HINNER
                |       HIDENTIFIER
                        HLABELSEPARATOR
                                {}
                        DECLSTATEMENT
                |       EXPRESSION_SIMP
                        HBEGIN
                                {}
                        IMPORT_SPEC_MODULE
                                {}
                        MBEE_DECLSTMS
                        HEND
                |       EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
                        MBEE_DECLSTMS HEND
                |       EXPRESSION_SIMP HBEGIN error HEND
                |       EXPRESSION_SIMP
                |       ACTIVATOR EXPRESSION SCHEDULE
                |       HBEGIN
                                {}
                        MBEE_DECLSTMS
                        HEND
                |       MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                {}
                        HEADING BLOCK
                |       HIDENTIFIER
                        HCLASS
                        NO_TYPE
                                {}
                        IMPORT_SPEC_MODULE
                        HIDENTIFIER
                                {}
                        HEADING
                        BLOCK
                |       HCLASS
                        NO_TYPE
                        HIDENTIFIER
                                {}
                        HEADING
                        BLOCK
                |       EXT_DECLARATION
                |       /*EMPT*/
                ;
IMPORT_SPEC_MODULE:
                ;
DECLSTATEMENT   :       MODULSTATEMENT
                |       TYPE
                        HIDENTIFIER
                        MBEE_CONSTANT
                        HPAREXPSEPARATOR
                                {}
                        IDENTIFIER_LISTC
                |       TYPE
                        HIDENTIFIER
                        MBEE_CONSTANT
                |       MBEE_TYPE
                        HARRAY  {}
                        ARR_SEGMENT_LIST
                |       HSWITCH
                        HIDENTIFIER
                        HASSIGN {}
                        SWITCH_LIST
                ;
BLOCK           :       DECLSTATEMENT
                |       HBEGIN MBEE_DECLSTMS HEND
                |       HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
                |       HBEGIN error HEND
                ;
MBEE_DECLSTMS   :       MBEE_DECLSTMSU
                ;
MBEE_DECLSTMSU  :       DECLSTATEMENT
                |       MBEE_DECLSTMSU
                        HSTATEMENTSEPARATOR
                        DECLSTATEMENT
                ;
MODULS          :       MODULSTATEMENT
                |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
                ;
/* GRAMATIKK FOR DEL AV DEKLARASJONER */
ARR_SEGMENT_LIST:       ARR_SEGMENT
                |       ARR_SEGMENT_LIST
                        HPAREXPSEPARATOR
                        ARR_SEGMENT
                ;
ARR_SEGMENT     :       ARRAY_SEGMENT
                        HBEGPAR
                        BAUND_PAIR_LIST HENDPAR
                ;
ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}

                |       ARRAY_SEGMENT_EL
                        HPAREXPSEPARATOR
                        ARRAY_SEGMENT
                ;
ARRAY_SEGMENT_EL:       HIDENTIFIER
                ;
BAUND_PAIR_LIST :       BAUND_PAIR
                |       BAUND_PAIR
                        HPAREXPSEPARATOR
                        BAUND_PAIR_LIST
                ;
BAUND_PAIR      :       EXPRESSION
                        HLABELSEPARATOR
                        EXPRESSION
                ;
SWITCH_LIST     :       EXPRESSION
                |       EXPRESSION
                        HPAREXPSEPARATOR
                        SWITCH_LIST
                ;
HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
                        MBEE_MODE_PART  {}
                        MBEE_SPEC_PART  {}
                        MBEE_PROT_PART  {}
                        MBEE_VIRT_PART
                ;
MBEE_FMAL_PAR_P :       /*EMPT*/
                |       FMAL_PAR_PART
                ;
FMAL_PAR_PART   :       HBEGPAR NO_TYPE
                        MBEE_LISTV HENDPAR
                ;
MBEE_LISTV      :       /*EMPT*/
                |       LISTV
                ;
LISTV           :       HIDENTIFIER
                |       FPP_CATEG HDOTDOTDOT
                |       HIDENTIFIER     {}
                        HPAREXPSEPARATOR LISTV
                |       FPP_SPEC
                |       FPP_SPEC
                        HPAREXPSEPARATOR LISTV
                ;
FPP_HEADING     :       HBEGPAR NO_TYPE
                        FPP_MBEE_LISTV HENDPAR
                ;
FPP_MBEE_LISTV  :       /*EMPT*/
                |       FPP_LISTV
                ;
FPP_LISTV       :       FPP_CATEG HDOTDOTDOT
                |       FPP_SPEC
                |       FPP_SPEC
                        HPAREXPSEPARATOR LISTV
                ;
FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
                |       FPP_CATEG FPP_PROC_DECL_IN_SPEC
                ;
FPP_CATEG       :       HNAME HLABELSEPARATOR
                |       HVALUE HLABELSEPARATOR
                |       HVAR HLABELSEPARATOR
                |       /*EMPT*/
                ;
FPP_PROC_DECL_IN_SPEC:  MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                        {}
                        FPP_HEADING {} { /* Yes, two "final" actions. */ }
                ;
IDENTIFIER_LISTV:       HIDENTIFIER
                |       HDOTDOTDOT
                |       HIDENTIFIER     {}
                        HPAREXPSEPARATOR IDENTIFIER_LISTV
                ;
MBEE_MODE_PART  :       /*EMPT*/
                |       MODE_PART
                ;
MODE_PART       :       NAME_PART
                |       VALUE_PART
                |       VAR_PART
                |       NAME_PART VALUE_PART
                |       VALUE_PART NAME_PART
                |       NAME_PART VAR_PART
                |       VAR_PART NAME_PART
                |       VALUE_PART VAR_PART
                |       VAR_PART VALUE_PART
                |       VAR_PART NAME_PART VALUE_PART
                |       NAME_PART VAR_PART VALUE_PART
                |       NAME_PART VALUE_PART VAR_PART
                |       VAR_PART VALUE_PART NAME_PART
                |       VALUE_PART VAR_PART NAME_PART
                |       VALUE_PART NAME_PART VAR_PART
                ;
NAME_PART       :       HNAME           {}
                        IDENTIFIER_LISTV
                        HSTATEMENTSEPARATOR
                ;
VAR_PART        :       HVAR            {}
                        IDENTIFIER_LISTV
                        HSTATEMENTSEPARATOR
                ;
VALUE_PART      :       HVALUE          {}
                        IDENTIFIER_LISTV HSTATEMENTSEPARATOR
                ;
MBEE_SPEC_PART  :       /*EMPT*/
                |       SPEC_PART
                ;
SPEC_PART       :       ONE_SPEC
                |       SPEC_PART ONE_SPEC
                ;
ONE_SPEC        :       SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
                |       NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
                          {}
                        PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                |       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
                ;
SPECIFIER       :       TYPE
                |       MBEE_TYPE
                        HARRAY
                |       HLABEL
                |       HSWITCH
                ;
PROC_DECL_IN_SPEC:      MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                        {}
                        HEADING
                                        {}
                        MBEE_BEGIN_END
                ;
MBEE_BEGIN_END  :       /* EMPTY */
                |       HBEGIN HEND
                ;
MBEE_PROT_PART  :       /*EMPT*/
                |       PROTECTION_PART
                ;
PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
                        HSTATEMENTSEPARATOR
                |       PROTECTION_PART  PROT_SPECIFIER
                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
                ;
PROT_SPECIFIER  :       HHIDDEN
                |       HPROTECTED
                |       HHIDDEN
                        HPROTECTED
                |       HPROTECTED
                        HHIDDEN
                ;
MBEE_VIRT_PART  :       /*EMPT*/
                |       VIRTUAL_PART
                ;
VIRTUAL_PART    :       HVIRTUAL
                        HLABELSEPARATOR
                        MBEE_SPEC_PART
                ;
IDENTIFIER_LIST :       HIDENTIFIER
                |       IDENTIFIER_LIST HPAREXPSEPARATOR
                        HIDENTIFIER
                ;
IDENTIFIER_LISTC:       HIDENTIFIER
                        MBEE_CONSTANT
                |       IDENTIFIER_LISTC HPAREXPSEPARATOR
                        HIDENTIFIER
                        MBEE_CONSTANT
                ;
MBEE_CONSTANT   :       /* EMPTY */
                |       HVALRELOPERATOR
                                {}
                        EXPRESSION
                ;

/* GRAMATIKK FOR UTTRYKK */
EXPRESSION      :       EXPRESSION_SIMP
                |       HIF
                        EXPRESSION
                        HTHEN
                        EXPRESSION
                        HELSE
                        EXPRESSION
                ;
EXPRESSION_SIMP :       EXPRESSION_SIMP
                        HASSIGN
                        EXPRESSION
                |

                        EXPRESSION_SIMP
                        HCONC
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP HOR
                        HELSE
                        EXPRESSION_SIMP
                        %prec HORELSE
                |       EXPRESSION_SIMP HAND
                        HTHEN
                        EXPRESSION_SIMP
                        %prec HANDTHEN
                |       EXPRESSION_SIMP
                        HEQV EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HIMP EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HOR EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HAND EXPRESSION_SIMP
                |       HNOT EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HVALRELOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HREFRELOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HOBJRELOPERATOR
                        EXPRESSION_SIMP
                |       HTERMOPERATOR
                        EXPRESSION_SIMP %prec UNEAR
                |       EXPRESSION_SIMP
                        HTERMOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HFACTOROPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HPRIMARYOPERATOR
                        EXPRESSION_SIMP
                |       HBEGPAR
                        EXPRESSION HENDPAR
                |       HTEXTKONST
                |       HCHARACTERKONST
                |       HREALKONST
                |       HINTEGERKONST
                |       HBOOLEANKONST
                |       HNONE
                |       HIDENTIFIER
                                {}
                        MBEE_ARG_R_PT
                |       HTHIS HIDENTIFIER
                |       HNEW
                        HIDENTIFIER
                        ARG_R_PT
                |       EXPRESSION_SIMP
                        HDOT
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HQUA HIDENTIFIER
                ;
ARG_R_PT        :       /*EMPTY*/
                |       HBEGPAR
                        ARGUMENT_LIST HENDPAR
                ;
MBEE_ARG_R_PT   :       /*EMPTY*/
                |       HBEGPAR
                        ARGUMENT_LIST HENDPAR
                ;
ARGUMENT_LIST   :       EXPRESSION
                |       EXPRESSION
                        HPAREXPSEPARATOR
                        ARGUMENT_LIST
                ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:811: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:128.12: warning: empty rule without %empty [-Wempty-rule]
input.y:137.10: warning: empty rule without %empty [-Wempty-rule]
input.y:142.8: warning: empty rule without %empty [-Wempty-rule]
input.y:161.15: warning: empty rule without %empty [-Wempty-rule]
input.y:179.17: warning: empty rule without %empty [-Wempty-rule]
input.y:205.16: warning: empty rule without %empty [-Wempty-rule]
input.y:213.9: warning: empty rule without %empty [-Wempty-rule]
input.y:225.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.18: warning: empty rule without %empty [-Wempty-rule]
input.y:294.19: warning: empty rule without %empty [-Wempty-rule]
input.y:367.16: warning: empty rule without %empty [-Wempty-rule]
input.y:373.11: warning: empty rule without %empty [-Wempty-rule]
input.y:387.15: warning: empty rule without %empty [-Wempty-rule]
input.y:401.18: warning: empty rule without %empty [-Wempty-rule]
input.y:413.15: warning: empty rule without %empty [-Wempty-rule]
input.y:443.15: warning: empty rule without %empty [-Wempty-rule]
input.y:471.15: warning: empty rule without %empty [-Wempty-rule]
input.y:474.15: warning: empty rule without %empty [-Wempty-rule]
input.y:489.15: warning: empty rule without %empty [-Wempty-rule]
input.y:506.14: warning: empty rule without %empty [-Wempty-rule]
input.y:587.9: warning: empty rule without %empty [-Wempty-rule]
input.y:591.14: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]
input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:128.12: warning: empty rule without %empty [-Wempty-rule]
input.y:137.10: warning: empty rule without %empty [-Wempty-rule]
input.y:142.8: warning: empty rule without %empty [-Wempty-rule]
input.y:161.15: warning: empty rule without %empty [-Wempty-rule]
input.y:179.17: warning: empty rule without %empty [-Wempty-rule]
input.y:205.16: warning: empty rule without %empty [-Wempty-rule]
input.y:213.9: warning: empty rule without %empty [-Wempty-rule]
input.y:225.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.18: warning: empty rule without %empty [-Wempty-rule]
input.y:294.19: warning: empty rule without %empty [-Wempty-rule]
input.y:367.16: warning: empty rule without %empty [-Wempty-rule]
input.y:373.11: warning: empty rule without %empty [-Wempty-rule]
input.y:387.15: warning: empty rule without %empty [-Wempty-rule]
input.y:401.18: warning: empty rule without %empty [-Wempty-rule]
input.y:413.15: warning: empty rule without %empty [-Wempty-rule]
input.y:443.15: warning: empty rule without %empty [-Wempty-rule]
input.y:471.15: warning: empty rule without %empty [-Wempty-rule]
input.y:474.15: warning: empty rule without %empty [-Wempty-rule]
input.y:489.15: warning: empty rule without %empty [-Wempty-rule]
input.y:506.14: warning: empty rule without %empty [-Wempty-rule]
input.y:587.9: warning: empty rule without %empty [-Wempty-rule]
input.y:591.14: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]
input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:811: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:811: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:811"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "442
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811: diff -u /dev/null /dev/null || exit 77"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; diff -u /dev/null /dev/null || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:811"
( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input-lalr.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:811: bison -fno-caret --report=all input-lalr.y"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; bison -fno-caret --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811: diff -u input-lalr.output input.output \\
           | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:811"
( $at_check_trace; diff -u input-lalr.output input.output \
           | sed -n '/^@@/,$p' | sed 's/^ $//'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
$as_echo "$at_srcdir/existing.at:811: grep '^State.*conflicts:' input.output"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; grep '^State.*conflicts:' 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"; $as_echo "State 64 conflicts: 14 shift/reduce
State 164 conflicts: 1 shift/reduce
State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
State 206 conflicts: 1 shift/reduce
State 240 conflicts: 1 shift/reduce
State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
State 356 conflicts: 1 shift/reduce
State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/existing.at:811: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:811"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:811: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; 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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:811' \
  "GNU Cim Grammar: IELR(1)" "                       " 17
at_xfail=no
(
  $as_echo "382. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type ielr

%token
        HACTIVATE HAFTER /*HAND*/ HARRAY HAT
        HBEFORE HBEGIN HBOOLEAN
        HCHARACTER HCLASS /*HCOMMENT*/ HCONC
        HDELAY HDO
        HELSE HEND HEQ /*HEQV*/ HEXTERNAL
        HFOR
        HGE HGO HGOTO HGT
        HHIDDEN
        HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
        HLABEL HLE HLONG HLT
        HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
        /*HOR*/ HOTHERWISE
        HPRIOR HPROCEDURE HPROTECTED
        HQUA
        HREACTIVATE HREAL HREF
        HSHORT HSTEP HSWITCH
        HTEXT HTHEN HTHIS HTO
        HUNTIL
        HVALUE HVAR HVIRTUAL
        HWHEN HWHILE

        HASSIGNVALUE HASSIGNREF
        /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
        HBEGPAR HENDPAR
        HEQR HNER
        HADD HSUB HMUL HDIV HINTDIV HEXP
        HDOTDOTDOT

%token HIDENTIFIER
%token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
%token HREALKONST
%token HTEXTKONST


%right HASSIGN
%left   HORELSE
%left   HANDTHEN
%left   HEQV
%left   HIMP
%left   HOR
%left   HAND

%left   HNOT

%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR

%left   HCONC

%left HTERMOPERATOR
%left UNEAR
%left HFACTOROPERATOR
%left         HPRIMARYOPERATOR

%left   HQUA

%left   HDOT

%start  MAIN_MODULE


%%


/* GRAMATIKK FOR PROGRAM MODULES */
MAIN_MODULE     :       {}
                        MODULS
                |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
                ;
EXT_DECLARATION :       HEXTERNAL
                        MBEE_TYPE
                        HPROCEDURE
                                {}
                        EXT_LIST
                |
                        HEXTERNAL
                        HIDENTIFIER
                        HPROCEDURE
                                {}
                        HIDENTIFIER {}
                        EXTERNAL_KIND_ITEM
                |       HEXTERNAL
                        HCLASS
                                {}
                        EXT_LIST

                ;
EXTERNAL_KIND_ITEM:     EXT_IDENT
                        HOBJRELOPERATOR
                                {}
                        MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                {}
                        HEADING EMPTY_BLOCK
                                {}
/*              |
                        EXT_IDENT
                                {}
                        MBEE_REST_EXT_LIST
                ;
MBEE_REST_EXT_LIST:     /* EMPTY
                |       HPAREXPSEPARATOR EXT_KIND_LIST
                ;
EXT_KIND_LIST   :       EXT_KIND_ITEM
                |       EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
                ;
EXT_KIND_ITEM   :       HIDENTIFIER
                        EXT_IDENT
                                {}*/
                ;
EMPTY_BLOCK     :       /*EMPT*/
                |       HBEGIN HEND
                ;
EXT_LIST        :       EXT_ITEM
                |       EXT_LIST HPAREXPSEPARATOR EXT_ITEM
                ;
EXT_ITEM        :       HIDENTIFIER
                        EXT_IDENT
                ;
EXT_IDENT       :       /* EMPTY */
                |       HVALRELOPERATOR {}
                        HTEXTKONST
                ;
/* GRAMATIKK FOR TYPER */
NO_TYPE         :       /*EMPT*/
                ;
MBEE_TYPE       :       NO_TYPE
                |       TYPE
                ;
TYPE            :       HREF HBEGPAR
                        HIDENTIFIER
                                {}
                        HENDPAR
                |       HTEXT
                |       HBOOLEAN
                |       HCHARACTER
                |       HSHORT HINTEGER
                |       HINTEGER
                |       HREAL
                |       HLONG HREAL
                ;

/* GRAMATIKK FOR DEL AV SETNINGER */
MBEE_ELSE_PART  :       /*EMPT*/
/*              |       HELSE
                        HIF
                        EXPRESSION
                        HTHEN   {}
                        BLOCK   {}
                        MBEE_ELSE_PART          {}*/
                |       HELSE   {}
                        BLOCK
                ;
FOR_LIST        :       FOR_LIST_ELEMENT
                |       FOR_LIST_ELEMENT
                        HPAREXPSEPARATOR
                        FOR_LIST
                ;
FOR_LIST_ELEMENT:       EXPRESSION
                        MBEE_F_L_EL_R_PT
                ;
MBEE_F_L_EL_R_PT:       /*EMPT*/
                |       HWHILE
                        EXPRESSION
                |       HSTEP
                        EXPRESSION
                        HUNTIL
                        EXPRESSION
                ;
GOTO            :       HGO
                        HTO
                |       HGOTO
                ;
CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
                |       HDO   {}
                        BLOCK
                ;
WHEN_CLAUSE_LIST:       HWHEN
                        HIDENTIFIER
                        HDO    {}
                        BLOCK
                |       WHEN_CLAUSE_LIST
                        HWHEN
                        HIDENTIFIER
                        HDO    {}
                        BLOCK
                ;
MBEE_OTWI_CLAUS :       /*EMPT*/
                |       HOTHERWISE {}

                        BLOCK
                ;
ACTIVATOR       :       HACTIVATE
                |       HREACTIVATE
                ;
SCHEDULE        :       /*EMPT*/
                |       ATDELAY EXPRESSION      {}
                        PRIOR
                |       BEFOREAFTER             {}
                        EXPRESSION
                ;
ATDELAY         :       HAT
                |       HDELAY
                ;
BEFOREAFTER     :       HBEFORE
                |       HAFTER
                ;
PRIOR           :       /*EMPT*/
                |       HPRIOR
                ;
/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
MODULSTATEMENT  :       HWHILE
                        EXPRESSION
                        HDO     {}
                        BLOCK
                |       HIF
                        EXPRESSION
                        HTHEN   {}
                        BLOCK   {}
                        MBEE_ELSE_PART
                |       HFOR
                        HIDENTIFIER
                        HASSIGN {}
                        FOR_LIST
                        HDO     {}
                        BLOCK
                |       GOTO
                        EXPRESSION
                |       HINSPECT
                        EXPRESSION              {}
                        CONN_STATE_R_PT
                                {}
                        MBEE_OTWI_CLAUS
                |       HINNER
                |       HIDENTIFIER
                        HLABELSEPARATOR
                                {}
                        DECLSTATEMENT
                |       EXPRESSION_SIMP
                        HBEGIN
                                {}
                        IMPORT_SPEC_MODULE
                                {}
                        MBEE_DECLSTMS
                        HEND
                |       EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
                        MBEE_DECLSTMS HEND
                |       EXPRESSION_SIMP HBEGIN error HEND
                |       EXPRESSION_SIMP
                |       ACTIVATOR EXPRESSION SCHEDULE
                |       HBEGIN
                                {}
                        MBEE_DECLSTMS
                        HEND
                |       MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                {}
                        HEADING BLOCK
                |       HIDENTIFIER
                        HCLASS
                        NO_TYPE
                                {}
                        IMPORT_SPEC_MODULE
                        HIDENTIFIER
                                {}
                        HEADING
                        BLOCK
                |       HCLASS
                        NO_TYPE
                        HIDENTIFIER
                                {}
                        HEADING
                        BLOCK
                |       EXT_DECLARATION
                |       /*EMPT*/
                ;
IMPORT_SPEC_MODULE:
                ;
DECLSTATEMENT   :       MODULSTATEMENT
                |       TYPE
                        HIDENTIFIER
                        MBEE_CONSTANT
                        HPAREXPSEPARATOR
                                {}
                        IDENTIFIER_LISTC
                |       TYPE
                        HIDENTIFIER
                        MBEE_CONSTANT
                |       MBEE_TYPE
                        HARRAY  {}
                        ARR_SEGMENT_LIST
                |       HSWITCH
                        HIDENTIFIER
                        HASSIGN {}
                        SWITCH_LIST
                ;
BLOCK           :       DECLSTATEMENT
                |       HBEGIN MBEE_DECLSTMS HEND
                |       HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
                |       HBEGIN error HEND
                ;
MBEE_DECLSTMS   :       MBEE_DECLSTMSU
                ;
MBEE_DECLSTMSU  :       DECLSTATEMENT
                |       MBEE_DECLSTMSU
                        HSTATEMENTSEPARATOR
                        DECLSTATEMENT
                ;
MODULS          :       MODULSTATEMENT
                |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
                ;
/* GRAMATIKK FOR DEL AV DEKLARASJONER */
ARR_SEGMENT_LIST:       ARR_SEGMENT
                |       ARR_SEGMENT_LIST
                        HPAREXPSEPARATOR
                        ARR_SEGMENT
                ;
ARR_SEGMENT     :       ARRAY_SEGMENT
                        HBEGPAR
                        BAUND_PAIR_LIST HENDPAR
                ;
ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}

                |       ARRAY_SEGMENT_EL
                        HPAREXPSEPARATOR
                        ARRAY_SEGMENT
                ;
ARRAY_SEGMENT_EL:       HIDENTIFIER
                ;
BAUND_PAIR_LIST :       BAUND_PAIR
                |       BAUND_PAIR
                        HPAREXPSEPARATOR
                        BAUND_PAIR_LIST
                ;
BAUND_PAIR      :       EXPRESSION
                        HLABELSEPARATOR
                        EXPRESSION
                ;
SWITCH_LIST     :       EXPRESSION
                |       EXPRESSION
                        HPAREXPSEPARATOR
                        SWITCH_LIST
                ;
HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
                        MBEE_MODE_PART  {}
                        MBEE_SPEC_PART  {}
                        MBEE_PROT_PART  {}
                        MBEE_VIRT_PART
                ;
MBEE_FMAL_PAR_P :       /*EMPT*/
                |       FMAL_PAR_PART
                ;
FMAL_PAR_PART   :       HBEGPAR NO_TYPE
                        MBEE_LISTV HENDPAR
                ;
MBEE_LISTV      :       /*EMPT*/
                |       LISTV
                ;
LISTV           :       HIDENTIFIER
                |       FPP_CATEG HDOTDOTDOT
                |       HIDENTIFIER     {}
                        HPAREXPSEPARATOR LISTV
                |       FPP_SPEC
                |       FPP_SPEC
                        HPAREXPSEPARATOR LISTV
                ;
FPP_HEADING     :       HBEGPAR NO_TYPE
                        FPP_MBEE_LISTV HENDPAR
                ;
FPP_MBEE_LISTV  :       /*EMPT*/
                |       FPP_LISTV
                ;
FPP_LISTV       :       FPP_CATEG HDOTDOTDOT
                |       FPP_SPEC
                |       FPP_SPEC
                        HPAREXPSEPARATOR LISTV
                ;
FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
                |       FPP_CATEG FPP_PROC_DECL_IN_SPEC
                ;
FPP_CATEG       :       HNAME HLABELSEPARATOR
                |       HVALUE HLABELSEPARATOR
                |       HVAR HLABELSEPARATOR
                |       /*EMPT*/
                ;
FPP_PROC_DECL_IN_SPEC:  MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                        {}
                        FPP_HEADING {} { /* Yes, two "final" actions. */ }
                ;
IDENTIFIER_LISTV:       HIDENTIFIER
                |       HDOTDOTDOT
                |       HIDENTIFIER     {}
                        HPAREXPSEPARATOR IDENTIFIER_LISTV
                ;
MBEE_MODE_PART  :       /*EMPT*/
                |       MODE_PART
                ;
MODE_PART       :       NAME_PART
                |       VALUE_PART
                |       VAR_PART
                |       NAME_PART VALUE_PART
                |       VALUE_PART NAME_PART
                |       NAME_PART VAR_PART
                |       VAR_PART NAME_PART
                |       VALUE_PART VAR_PART
                |       VAR_PART VALUE_PART
                |       VAR_PART NAME_PART VALUE_PART
                |       NAME_PART VAR_PART VALUE_PART
                |       NAME_PART VALUE_PART VAR_PART
                |       VAR_PART VALUE_PART NAME_PART
                |       VALUE_PART VAR_PART NAME_PART
                |       VALUE_PART NAME_PART VAR_PART
                ;
NAME_PART       :       HNAME           {}
                        IDENTIFIER_LISTV
                        HSTATEMENTSEPARATOR
                ;
VAR_PART        :       HVAR            {}
                        IDENTIFIER_LISTV
                        HSTATEMENTSEPARATOR
                ;
VALUE_PART      :       HVALUE          {}
                        IDENTIFIER_LISTV HSTATEMENTSEPARATOR
                ;
MBEE_SPEC_PART  :       /*EMPT*/
                |       SPEC_PART
                ;
SPEC_PART       :       ONE_SPEC
                |       SPEC_PART ONE_SPEC
                ;
ONE_SPEC        :       SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
                |       NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
                          {}
                        PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                |       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
                ;
SPECIFIER       :       TYPE
                |       MBEE_TYPE
                        HARRAY
                |       HLABEL
                |       HSWITCH
                ;
PROC_DECL_IN_SPEC:      MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                        {}
                        HEADING
                                        {}
                        MBEE_BEGIN_END
                ;
MBEE_BEGIN_END  :       /* EMPTY */
                |       HBEGIN HEND
                ;
MBEE_PROT_PART  :       /*EMPT*/
                |       PROTECTION_PART
                ;
PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
                        HSTATEMENTSEPARATOR
                |       PROTECTION_PART  PROT_SPECIFIER
                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
                ;
PROT_SPECIFIER  :       HHIDDEN
                |       HPROTECTED
                |       HHIDDEN
                        HPROTECTED
                |       HPROTECTED
                        HHIDDEN
                ;
MBEE_VIRT_PART  :       /*EMPT*/
                |       VIRTUAL_PART
                ;
VIRTUAL_PART    :       HVIRTUAL
                        HLABELSEPARATOR
                        MBEE_SPEC_PART
                ;
IDENTIFIER_LIST :       HIDENTIFIER
                |       IDENTIFIER_LIST HPAREXPSEPARATOR
                        HIDENTIFIER
                ;
IDENTIFIER_LISTC:       HIDENTIFIER
                        MBEE_CONSTANT
                |       IDENTIFIER_LISTC HPAREXPSEPARATOR
                        HIDENTIFIER
                        MBEE_CONSTANT
                ;
MBEE_CONSTANT   :       /* EMPTY */
                |       HVALRELOPERATOR
                                {}
                        EXPRESSION
                ;

/* GRAMATIKK FOR UTTRYKK */
EXPRESSION      :       EXPRESSION_SIMP
                |       HIF
                        EXPRESSION
                        HTHEN
                        EXPRESSION
                        HELSE
                        EXPRESSION
                ;
EXPRESSION_SIMP :       EXPRESSION_SIMP
                        HASSIGN
                        EXPRESSION
                |

                        EXPRESSION_SIMP
                        HCONC
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP HOR
                        HELSE
                        EXPRESSION_SIMP
                        %prec HORELSE
                |       EXPRESSION_SIMP HAND
                        HTHEN
                        EXPRESSION_SIMP
                        %prec HANDTHEN
                |       EXPRESSION_SIMP
                        HEQV EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HIMP EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HOR EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HAND EXPRESSION_SIMP
                |       HNOT EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HVALRELOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HREFRELOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HOBJRELOPERATOR
                        EXPRESSION_SIMP
                |       HTERMOPERATOR
                        EXPRESSION_SIMP %prec UNEAR
                |       EXPRESSION_SIMP
                        HTERMOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HFACTOROPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HPRIMARYOPERATOR
                        EXPRESSION_SIMP
                |       HBEGPAR
                        EXPRESSION HENDPAR
                |       HTEXTKONST
                |       HCHARACTERKONST
                |       HREALKONST
                |       HINTEGERKONST
                |       HBOOLEANKONST
                |       HNONE
                |       HIDENTIFIER
                                {}
                        MBEE_ARG_R_PT
                |       HTHIS HIDENTIFIER
                |       HNEW
                        HIDENTIFIER
                        ARG_R_PT
                |       EXPRESSION_SIMP
                        HDOT
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HQUA HIDENTIFIER
                ;
ARG_R_PT        :       /*EMPTY*/
                |       HBEGPAR
                        ARGUMENT_LIST HENDPAR
                ;
MBEE_ARG_R_PT   :       /*EMPTY*/
                |       HBEGPAR
                        ARGUMENT_LIST HENDPAR
                ;
ARGUMENT_LIST   :       EXPRESSION
                |       EXPRESSION
                        HPAREXPSEPARATOR
                        ARGUMENT_LIST
                ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:811: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:128.12: warning: empty rule without %empty [-Wempty-rule]
input.y:137.10: warning: empty rule without %empty [-Wempty-rule]
input.y:142.8: warning: empty rule without %empty [-Wempty-rule]
input.y:161.15: warning: empty rule without %empty [-Wempty-rule]
input.y:179.17: warning: empty rule without %empty [-Wempty-rule]
input.y:205.16: warning: empty rule without %empty [-Wempty-rule]
input.y:213.9: warning: empty rule without %empty [-Wempty-rule]
input.y:225.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.18: warning: empty rule without %empty [-Wempty-rule]
input.y:294.19: warning: empty rule without %empty [-Wempty-rule]
input.y:367.16: warning: empty rule without %empty [-Wempty-rule]
input.y:373.11: warning: empty rule without %empty [-Wempty-rule]
input.y:387.15: warning: empty rule without %empty [-Wempty-rule]
input.y:401.18: warning: empty rule without %empty [-Wempty-rule]
input.y:413.15: warning: empty rule without %empty [-Wempty-rule]
input.y:443.15: warning: empty rule without %empty [-Wempty-rule]
input.y:471.15: warning: empty rule without %empty [-Wempty-rule]
input.y:474.15: warning: empty rule without %empty [-Wempty-rule]
input.y:489.15: warning: empty rule without %empty [-Wempty-rule]
input.y:506.14: warning: empty rule without %empty [-Wempty-rule]
input.y:587.9: warning: empty rule without %empty [-Wempty-rule]
input.y:591.14: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]
input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:128.12: warning: empty rule without %empty [-Wempty-rule]
input.y:137.10: warning: empty rule without %empty [-Wempty-rule]
input.y:142.8: warning: empty rule without %empty [-Wempty-rule]
input.y:161.15: warning: empty rule without %empty [-Wempty-rule]
input.y:179.17: warning: empty rule without %empty [-Wempty-rule]
input.y:205.16: warning: empty rule without %empty [-Wempty-rule]
input.y:213.9: warning: empty rule without %empty [-Wempty-rule]
input.y:225.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.18: warning: empty rule without %empty [-Wempty-rule]
input.y:294.19: warning: empty rule without %empty [-Wempty-rule]
input.y:367.16: warning: empty rule without %empty [-Wempty-rule]
input.y:373.11: warning: empty rule without %empty [-Wempty-rule]
input.y:387.15: warning: empty rule without %empty [-Wempty-rule]
input.y:401.18: warning: empty rule without %empty [-Wempty-rule]
input.y:413.15: warning: empty rule without %empty [-Wempty-rule]
input.y:443.15: warning: empty rule without %empty [-Wempty-rule]
input.y:471.15: warning: empty rule without %empty [-Wempty-rule]
input.y:474.15: warning: empty rule without %empty [-Wempty-rule]
input.y:489.15: warning: empty rule without %empty [-Wempty-rule]
input.y:506.14: warning: empty rule without %empty [-Wempty-rule]
input.y:587.9: warning: empty rule without %empty [-Wempty-rule]
input.y:591.14: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]
input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:811: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:811: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:811"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "442
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811: diff -u /dev/null /dev/null || exit 77"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; diff -u /dev/null /dev/null || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:811"
( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input-lalr.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:811: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:811"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:811: bison -fno-caret --report=all input-lalr.y"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; bison -fno-caret --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811: diff -u input-lalr.output input.output \\
           | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:811"
( $at_check_trace; diff -u input-lalr.output input.output \
           | sed -n '/^@@/,$p' | sed 's/^ $//'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
$as_echo "$at_srcdir/existing.at:811: grep '^State.*conflicts:' input.output"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; grep '^State.*conflicts:' 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"; $as_echo "State 64 conflicts: 14 shift/reduce
State 164 conflicts: 1 shift/reduce
State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
State 206 conflicts: 1 shift/reduce
State 240 conflicts: 1 shift/reduce
State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
State 356 conflicts: 1 shift/reduce
State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/existing.at:811: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:811"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:811: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; 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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:811' \
  "GNU Cim Grammar: Canonical LR(1)" "               " 17
at_xfail=no
(
  $as_echo "383. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type canonical-lr

%token
        HACTIVATE HAFTER /*HAND*/ HARRAY HAT
        HBEFORE HBEGIN HBOOLEAN
        HCHARACTER HCLASS /*HCOMMENT*/ HCONC
        HDELAY HDO
        HELSE HEND HEQ /*HEQV*/ HEXTERNAL
        HFOR
        HGE HGO HGOTO HGT
        HHIDDEN
        HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
        HLABEL HLE HLONG HLT
        HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
        /*HOR*/ HOTHERWISE
        HPRIOR HPROCEDURE HPROTECTED
        HQUA
        HREACTIVATE HREAL HREF
        HSHORT HSTEP HSWITCH
        HTEXT HTHEN HTHIS HTO
        HUNTIL
        HVALUE HVAR HVIRTUAL
        HWHEN HWHILE

        HASSIGNVALUE HASSIGNREF
        /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
        HBEGPAR HENDPAR
        HEQR HNER
        HADD HSUB HMUL HDIV HINTDIV HEXP
        HDOTDOTDOT

%token HIDENTIFIER
%token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
%token HREALKONST
%token HTEXTKONST


%right HASSIGN
%left   HORELSE
%left   HANDTHEN
%left   HEQV
%left   HIMP
%left   HOR
%left   HAND

%left   HNOT

%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR

%left   HCONC

%left HTERMOPERATOR
%left UNEAR
%left HFACTOROPERATOR
%left         HPRIMARYOPERATOR

%left   HQUA

%left   HDOT

%start  MAIN_MODULE


%%


/* GRAMATIKK FOR PROGRAM MODULES */
MAIN_MODULE     :       {}
                        MODULS
                |       error HSTATEMENTSEPARATOR MBEE_DECLSTMS
                ;
EXT_DECLARATION :       HEXTERNAL
                        MBEE_TYPE
                        HPROCEDURE
                                {}
                        EXT_LIST
                |
                        HEXTERNAL
                        HIDENTIFIER
                        HPROCEDURE
                                {}
                        HIDENTIFIER {}
                        EXTERNAL_KIND_ITEM
                |       HEXTERNAL
                        HCLASS
                                {}
                        EXT_LIST

                ;
EXTERNAL_KIND_ITEM:     EXT_IDENT
                        HOBJRELOPERATOR
                                {}
                        MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                {}
                        HEADING EMPTY_BLOCK
                                {}
/*              |
                        EXT_IDENT
                                {}
                        MBEE_REST_EXT_LIST
                ;
MBEE_REST_EXT_LIST:     /* EMPTY
                |       HPAREXPSEPARATOR EXT_KIND_LIST
                ;
EXT_KIND_LIST   :       EXT_KIND_ITEM
                |       EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
                ;
EXT_KIND_ITEM   :       HIDENTIFIER
                        EXT_IDENT
                                {}*/
                ;
EMPTY_BLOCK     :       /*EMPT*/
                |       HBEGIN HEND
                ;
EXT_LIST        :       EXT_ITEM
                |       EXT_LIST HPAREXPSEPARATOR EXT_ITEM
                ;
EXT_ITEM        :       HIDENTIFIER
                        EXT_IDENT
                ;
EXT_IDENT       :       /* EMPTY */
                |       HVALRELOPERATOR {}
                        HTEXTKONST
                ;
/* GRAMATIKK FOR TYPER */
NO_TYPE         :       /*EMPT*/
                ;
MBEE_TYPE       :       NO_TYPE
                |       TYPE
                ;
TYPE            :       HREF HBEGPAR
                        HIDENTIFIER
                                {}
                        HENDPAR
                |       HTEXT
                |       HBOOLEAN
                |       HCHARACTER
                |       HSHORT HINTEGER
                |       HINTEGER
                |       HREAL
                |       HLONG HREAL
                ;

/* GRAMATIKK FOR DEL AV SETNINGER */
MBEE_ELSE_PART  :       /*EMPT*/
/*              |       HELSE
                        HIF
                        EXPRESSION
                        HTHEN   {}
                        BLOCK   {}
                        MBEE_ELSE_PART          {}*/
                |       HELSE   {}
                        BLOCK
                ;
FOR_LIST        :       FOR_LIST_ELEMENT
                |       FOR_LIST_ELEMENT
                        HPAREXPSEPARATOR
                        FOR_LIST
                ;
FOR_LIST_ELEMENT:       EXPRESSION
                        MBEE_F_L_EL_R_PT
                ;
MBEE_F_L_EL_R_PT:       /*EMPT*/
                |       HWHILE
                        EXPRESSION
                |       HSTEP
                        EXPRESSION
                        HUNTIL
                        EXPRESSION
                ;
GOTO            :       HGO
                        HTO
                |       HGOTO
                ;
CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
                |       HDO   {}
                        BLOCK
                ;
WHEN_CLAUSE_LIST:       HWHEN
                        HIDENTIFIER
                        HDO    {}
                        BLOCK
                |       WHEN_CLAUSE_LIST
                        HWHEN
                        HIDENTIFIER
                        HDO    {}
                        BLOCK
                ;
MBEE_OTWI_CLAUS :       /*EMPT*/
                |       HOTHERWISE {}

                        BLOCK
                ;
ACTIVATOR       :       HACTIVATE
                |       HREACTIVATE
                ;
SCHEDULE        :       /*EMPT*/
                |       ATDELAY EXPRESSION      {}
                        PRIOR
                |       BEFOREAFTER             {}
                        EXPRESSION
                ;
ATDELAY         :       HAT
                |       HDELAY
                ;
BEFOREAFTER     :       HBEFORE
                |       HAFTER
                ;
PRIOR           :       /*EMPT*/
                |       HPRIOR
                ;
/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
MODULSTATEMENT  :       HWHILE
                        EXPRESSION
                        HDO     {}
                        BLOCK
                |       HIF
                        EXPRESSION
                        HTHEN   {}
                        BLOCK   {}
                        MBEE_ELSE_PART
                |       HFOR
                        HIDENTIFIER
                        HASSIGN {}
                        FOR_LIST
                        HDO     {}
                        BLOCK
                |       GOTO
                        EXPRESSION
                |       HINSPECT
                        EXPRESSION              {}
                        CONN_STATE_R_PT
                                {}
                        MBEE_OTWI_CLAUS
                |       HINNER
                |       HIDENTIFIER
                        HLABELSEPARATOR
                                {}
                        DECLSTATEMENT
                |       EXPRESSION_SIMP
                        HBEGIN
                                {}
                        IMPORT_SPEC_MODULE
                                {}
                        MBEE_DECLSTMS
                        HEND
                |       EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
                        MBEE_DECLSTMS HEND
                |       EXPRESSION_SIMP HBEGIN error HEND
                |       EXPRESSION_SIMP
                |       ACTIVATOR EXPRESSION SCHEDULE
                |       HBEGIN
                                {}
                        MBEE_DECLSTMS
                        HEND
                |       MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                {}
                        HEADING BLOCK
                |       HIDENTIFIER
                        HCLASS
                        NO_TYPE
                                {}
                        IMPORT_SPEC_MODULE
                        HIDENTIFIER
                                {}
                        HEADING
                        BLOCK
                |       HCLASS
                        NO_TYPE
                        HIDENTIFIER
                                {}
                        HEADING
                        BLOCK
                |       EXT_DECLARATION
                |       /*EMPT*/
                ;
IMPORT_SPEC_MODULE:
                ;
DECLSTATEMENT   :       MODULSTATEMENT
                |       TYPE
                        HIDENTIFIER
                        MBEE_CONSTANT
                        HPAREXPSEPARATOR
                                {}
                        IDENTIFIER_LISTC
                |       TYPE
                        HIDENTIFIER
                        MBEE_CONSTANT
                |       MBEE_TYPE
                        HARRAY  {}
                        ARR_SEGMENT_LIST
                |       HSWITCH
                        HIDENTIFIER
                        HASSIGN {}
                        SWITCH_LIST
                ;
BLOCK           :       DECLSTATEMENT
                |       HBEGIN MBEE_DECLSTMS HEND
                |       HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
                |       HBEGIN error HEND
                ;
MBEE_DECLSTMS   :       MBEE_DECLSTMSU
                ;
MBEE_DECLSTMSU  :       DECLSTATEMENT
                |       MBEE_DECLSTMSU
                        HSTATEMENTSEPARATOR
                        DECLSTATEMENT
                ;
MODULS          :       MODULSTATEMENT
                |       MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
                ;
/* GRAMATIKK FOR DEL AV DEKLARASJONER */
ARR_SEGMENT_LIST:       ARR_SEGMENT
                |       ARR_SEGMENT_LIST
                        HPAREXPSEPARATOR
                        ARR_SEGMENT
                ;
ARR_SEGMENT     :       ARRAY_SEGMENT
                        HBEGPAR
                        BAUND_PAIR_LIST HENDPAR
                ;
ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}

                |       ARRAY_SEGMENT_EL
                        HPAREXPSEPARATOR
                        ARRAY_SEGMENT
                ;
ARRAY_SEGMENT_EL:       HIDENTIFIER
                ;
BAUND_PAIR_LIST :       BAUND_PAIR
                |       BAUND_PAIR
                        HPAREXPSEPARATOR
                        BAUND_PAIR_LIST
                ;
BAUND_PAIR      :       EXPRESSION
                        HLABELSEPARATOR
                        EXPRESSION
                ;
SWITCH_LIST     :       EXPRESSION
                |       EXPRESSION
                        HPAREXPSEPARATOR
                        SWITCH_LIST
                ;
HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
                        MBEE_MODE_PART  {}
                        MBEE_SPEC_PART  {}
                        MBEE_PROT_PART  {}
                        MBEE_VIRT_PART
                ;
MBEE_FMAL_PAR_P :       /*EMPT*/
                |       FMAL_PAR_PART
                ;
FMAL_PAR_PART   :       HBEGPAR NO_TYPE
                        MBEE_LISTV HENDPAR
                ;
MBEE_LISTV      :       /*EMPT*/
                |       LISTV
                ;
LISTV           :       HIDENTIFIER
                |       FPP_CATEG HDOTDOTDOT
                |       HIDENTIFIER     {}
                        HPAREXPSEPARATOR LISTV
                |       FPP_SPEC
                |       FPP_SPEC
                        HPAREXPSEPARATOR LISTV
                ;
FPP_HEADING     :       HBEGPAR NO_TYPE
                        FPP_MBEE_LISTV HENDPAR
                ;
FPP_MBEE_LISTV  :       /*EMPT*/
                |       FPP_LISTV
                ;
FPP_LISTV       :       FPP_CATEG HDOTDOTDOT
                |       FPP_SPEC
                |       FPP_SPEC
                        HPAREXPSEPARATOR LISTV
                ;
FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
                |       FPP_CATEG FPP_PROC_DECL_IN_SPEC
                ;
FPP_CATEG       :       HNAME HLABELSEPARATOR
                |       HVALUE HLABELSEPARATOR
                |       HVAR HLABELSEPARATOR
                |       /*EMPT*/
                ;
FPP_PROC_DECL_IN_SPEC:  MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                        {}
                        FPP_HEADING {} { /* Yes, two "final" actions. */ }
                ;
IDENTIFIER_LISTV:       HIDENTIFIER
                |       HDOTDOTDOT
                |       HIDENTIFIER     {}
                        HPAREXPSEPARATOR IDENTIFIER_LISTV
                ;
MBEE_MODE_PART  :       /*EMPT*/
                |       MODE_PART
                ;
MODE_PART       :       NAME_PART
                |       VALUE_PART
                |       VAR_PART
                |       NAME_PART VALUE_PART
                |       VALUE_PART NAME_PART
                |       NAME_PART VAR_PART
                |       VAR_PART NAME_PART
                |       VALUE_PART VAR_PART
                |       VAR_PART VALUE_PART
                |       VAR_PART NAME_PART VALUE_PART
                |       NAME_PART VAR_PART VALUE_PART
                |       NAME_PART VALUE_PART VAR_PART
                |       VAR_PART VALUE_PART NAME_PART
                |       VALUE_PART VAR_PART NAME_PART
                |       VALUE_PART NAME_PART VAR_PART
                ;
NAME_PART       :       HNAME           {}
                        IDENTIFIER_LISTV
                        HSTATEMENTSEPARATOR
                ;
VAR_PART        :       HVAR            {}
                        IDENTIFIER_LISTV
                        HSTATEMENTSEPARATOR
                ;
VALUE_PART      :       HVALUE          {}
                        IDENTIFIER_LISTV HSTATEMENTSEPARATOR
                ;
MBEE_SPEC_PART  :       /*EMPT*/
                |       SPEC_PART
                ;
SPEC_PART       :       ONE_SPEC
                |       SPEC_PART ONE_SPEC
                ;
ONE_SPEC        :       SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
                |       NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
                          {}
                        PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                |       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
                |       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
                ;
SPECIFIER       :       TYPE
                |       MBEE_TYPE
                        HARRAY
                |       HLABEL
                |       HSWITCH
                ;
PROC_DECL_IN_SPEC:      MBEE_TYPE HPROCEDURE
                        HIDENTIFIER
                                        {}
                        HEADING
                                        {}
                        MBEE_BEGIN_END
                ;
MBEE_BEGIN_END  :       /* EMPTY */
                |       HBEGIN HEND
                ;
MBEE_PROT_PART  :       /*EMPT*/
                |       PROTECTION_PART
                ;
PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
                        HSTATEMENTSEPARATOR
                |       PROTECTION_PART  PROT_SPECIFIER
                        IDENTIFIER_LIST HSTATEMENTSEPARATOR
                ;
PROT_SPECIFIER  :       HHIDDEN
                |       HPROTECTED
                |       HHIDDEN
                        HPROTECTED
                |       HPROTECTED
                        HHIDDEN
                ;
MBEE_VIRT_PART  :       /*EMPT*/
                |       VIRTUAL_PART
                ;
VIRTUAL_PART    :       HVIRTUAL
                        HLABELSEPARATOR
                        MBEE_SPEC_PART
                ;
IDENTIFIER_LIST :       HIDENTIFIER
                |       IDENTIFIER_LIST HPAREXPSEPARATOR
                        HIDENTIFIER
                ;
IDENTIFIER_LISTC:       HIDENTIFIER
                        MBEE_CONSTANT
                |       IDENTIFIER_LISTC HPAREXPSEPARATOR
                        HIDENTIFIER
                        MBEE_CONSTANT
                ;
MBEE_CONSTANT   :       /* EMPTY */
                |       HVALRELOPERATOR
                                {}
                        EXPRESSION
                ;

/* GRAMATIKK FOR UTTRYKK */
EXPRESSION      :       EXPRESSION_SIMP
                |       HIF
                        EXPRESSION
                        HTHEN
                        EXPRESSION
                        HELSE
                        EXPRESSION
                ;
EXPRESSION_SIMP :       EXPRESSION_SIMP
                        HASSIGN
                        EXPRESSION
                |

                        EXPRESSION_SIMP
                        HCONC
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP HOR
                        HELSE
                        EXPRESSION_SIMP
                        %prec HORELSE
                |       EXPRESSION_SIMP HAND
                        HTHEN
                        EXPRESSION_SIMP
                        %prec HANDTHEN
                |       EXPRESSION_SIMP
                        HEQV EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HIMP EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HOR EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HAND EXPRESSION_SIMP
                |       HNOT EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HVALRELOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HREFRELOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HOBJRELOPERATOR
                        EXPRESSION_SIMP
                |       HTERMOPERATOR
                        EXPRESSION_SIMP %prec UNEAR
                |       EXPRESSION_SIMP
                        HTERMOPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HFACTOROPERATOR
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HPRIMARYOPERATOR
                        EXPRESSION_SIMP
                |       HBEGPAR
                        EXPRESSION HENDPAR
                |       HTEXTKONST
                |       HCHARACTERKONST
                |       HREALKONST
                |       HINTEGERKONST
                |       HBOOLEANKONST
                |       HNONE
                |       HIDENTIFIER
                                {}
                        MBEE_ARG_R_PT
                |       HTHIS HIDENTIFIER
                |       HNEW
                        HIDENTIFIER
                        ARG_R_PT
                |       EXPRESSION_SIMP
                        HDOT
                        EXPRESSION_SIMP
                |       EXPRESSION_SIMP
                        HQUA HIDENTIFIER
                ;
ARG_R_PT        :       /*EMPTY*/
                |       HBEGPAR
                        ARGUMENT_LIST HENDPAR
                ;
MBEE_ARG_R_PT   :       /*EMPTY*/
                |       HBEGPAR
                        ARGUMENT_LIST HENDPAR
                ;
ARGUMENT_LIST   :       EXPRESSION
                |       EXPRESSION
                        HPAREXPSEPARATOR
                        ARGUMENT_LIST
                ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    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.

{ set +x
$as_echo "$at_srcdir/existing.at:811: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:128.12: warning: empty rule without %empty [-Wempty-rule]
input.y:137.10: warning: empty rule without %empty [-Wempty-rule]
input.y:142.8: warning: empty rule without %empty [-Wempty-rule]
input.y:161.15: warning: empty rule without %empty [-Wempty-rule]
input.y:179.17: warning: empty rule without %empty [-Wempty-rule]
input.y:205.16: warning: empty rule without %empty [-Wempty-rule]
input.y:213.9: warning: empty rule without %empty [-Wempty-rule]
input.y:225.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.18: warning: empty rule without %empty [-Wempty-rule]
input.y:294.19: warning: empty rule without %empty [-Wempty-rule]
input.y:367.16: warning: empty rule without %empty [-Wempty-rule]
input.y:373.11: warning: empty rule without %empty [-Wempty-rule]
input.y:387.15: warning: empty rule without %empty [-Wempty-rule]
input.y:401.18: warning: empty rule without %empty [-Wempty-rule]
input.y:413.15: warning: empty rule without %empty [-Wempty-rule]
input.y:443.15: warning: empty rule without %empty [-Wempty-rule]
input.y:471.15: warning: empty rule without %empty [-Wempty-rule]
input.y:474.15: warning: empty rule without %empty [-Wempty-rule]
input.y:489.15: warning: empty rule without %empty [-Wempty-rule]
input.y:506.14: warning: empty rule without %empty [-Wempty-rule]
input.y:587.9: warning: empty rule without %empty [-Wempty-rule]
input.y:591.14: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]
input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:128.12: warning: empty rule without %empty [-Wempty-rule]
input.y:137.10: warning: empty rule without %empty [-Wempty-rule]
input.y:142.8: warning: empty rule without %empty [-Wempty-rule]
input.y:161.15: warning: empty rule without %empty [-Wempty-rule]
input.y:179.17: warning: empty rule without %empty [-Wempty-rule]
input.y:205.16: warning: empty rule without %empty [-Wempty-rule]
input.y:213.9: warning: empty rule without %empty [-Wempty-rule]
input.y:225.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.18: warning: empty rule without %empty [-Wempty-rule]
input.y:294.19: warning: empty rule without %empty [-Wempty-rule]
input.y:367.16: warning: empty rule without %empty [-Wempty-rule]
input.y:373.11: warning: empty rule without %empty [-Wempty-rule]
input.y:387.15: warning: empty rule without %empty [-Wempty-rule]
input.y:401.18: warning: empty rule without %empty [-Wempty-rule]
input.y:413.15: warning: empty rule without %empty [-Wempty-rule]
input.y:443.15: warning: empty rule without %empty [-Wempty-rule]
input.y:471.15: warning: empty rule without %empty [-Wempty-rule]
input.y:474.15: warning: empty rule without %empty [-Wempty-rule]
input.y:489.15: warning: empty rule without %empty [-Wempty-rule]
input.y:506.14: warning: empty rule without %empty [-Wempty-rule]
input.y:587.9: warning: empty rule without %empty [-Wempty-rule]
input.y:591.14: warning: empty rule without %empty [-Wempty-rule]
input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]
input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence]
input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence]
input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence]
input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence]
input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence]
input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:811: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:811: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:811"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:811: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:811"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "10425
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$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 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
{ set +x
$as_echo "$at_srcdir/existing.at:811: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:811"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:811: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:811:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:811"
( $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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:811"
( $at_check_trace; 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/existing.at:811"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:1461' \
  "GNU pic (Groff 1.18.1) Grammar: LALR(1)" "        " 17
at_xfail=no
(
  $as_echo "384. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type lalr
%error-verbose

%token LABEL
%token VARIABLE
%token NUMBER
%token TEXT
%token COMMAND_LINE
%token DELIMITED
%token ORDINAL
%token TH
%token LEFT_ARROW_HEAD
%token RIGHT_ARROW_HEAD
%token DOUBLE_ARROW_HEAD
%token LAST
%token UP
%token DOWN
%token LEFT
%token RIGHT
%token BOX
%token CIRCLE
%token ELLIPSE
%token ARC
%token LINE
%token ARROW
%token MOVE
%token SPLINE
%token HEIGHT
%token RADIUS
%token WIDTH
%token DIAMETER
%token FROM
%token TO
%token AT
%token WITH
%token BY
%token THEN
%token SOLID
%token DOTTED
%token DASHED
%token CHOP
%token SAME
%token INVISIBLE
%token LJUST
%token RJUST
%token ABOVE
%token BELOW
%token OF
%token THE
%token WAY
%token BETWEEN
%token AND
%token HERE
%token DOT_N
%token DOT_E
%token DOT_W
%token DOT_S
%token DOT_NE
%token DOT_SE
%token DOT_NW
%token DOT_SW
%token DOT_C
%token DOT_START
%token DOT_END
%token DOT_X
%token DOT_Y
%token DOT_HT
%token DOT_WID
%token DOT_RAD
%token SIN
%token COS
%token ATAN2
%token LOG
%token EXP
%token SQRT
%token K_MAX
%token K_MIN
%token INT
%token RAND
%token SRAND
%token COPY
%token THROUGH
%token TOP
%token BOTTOM
%token UPPER
%token LOWER
%token SH
%token PRINT
%token CW
%token CCW
%token FOR
%token DO
%token IF
%token ELSE
%token ANDAND
%token OROR
%token NOTEQUAL
%token EQUALEQUAL
%token LESSEQUAL
%token GREATEREQUAL
%token LEFT_CORNER
%token RIGHT_CORNER
%token NORTH
%token SOUTH
%token EAST
%token WEST
%token CENTER
%token END
%token START
%token RESET
%token UNTIL
%token PLOT
%token THICKNESS
%token FILL
%token COLORED
%token OUTLINED
%token SHADED
%token ALIGNED
%token SPRINTF
%token COMMAND

%left '.'

/* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
%left PLOT
%left TEXT SPRINTF

/* give text adjustments higher precedence than TEXT, so that
box "foo" above ljust == box ("foo" above ljust)
*/

%left LJUST RJUST ABOVE BELOW

%left LEFT RIGHT
/* Give attributes that take an optional expression a higher
precedence than left and right, so that eg 'line chop left'
parses properly. */
%left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
%left LABEL

%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
%left ORDINAL HERE '`'

%left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */

/* these need to be lower than '-' */
%left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS

/* these must have higher precedence than CHOP so that 'label %prec CHOP'
works */
%left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
%left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
%left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END

%left ','
%left OROR
%left ANDAND
%left EQUALEQUAL NOTEQUAL
%left '<' '>' LESSEQUAL GREATEREQUAL

%left BETWEEN OF
%left AND

%left '+' '-'
%left '*' '/' '%'
%right '!'
%right '^'


%%


top:
        optional_separator
        | element_list
        ;

element_list:
        optional_separator middle_element_list optional_separator
        ;

middle_element_list:
        element
        | middle_element_list separator element
        ;

optional_separator:
        /* empty */
        | separator
        ;

separator:
        ';'
        | separator ';'
        ;

placeless_element:
        VARIABLE '=' any_expr
        | VARIABLE ':' '=' any_expr
        | UP
        | DOWN
        | LEFT
        | RIGHT
        | COMMAND_LINE
        | COMMAND print_args
        | PRINT print_args
        | SH
                {}
          DELIMITED
        | COPY TEXT
        | COPY TEXT THROUGH
                {}
          DELIMITED
                {}
          until
        | COPY THROUGH
                {}
          DELIMITED
                {}
          until
        | FOR VARIABLE '=' expr TO expr optional_by DO
                {}
          DELIMITED
        | simple_if
        | simple_if ELSE
                {}
          DELIMITED
        | reset_variables
        | RESET
        ;

reset_variables:
        RESET VARIABLE
        | reset_variables VARIABLE
        | reset_variables ',' VARIABLE
        ;

print_args:
        print_arg
        | print_args print_arg
        ;

print_arg:
        expr                                                    %prec ','
        | text
        | position                                              %prec ','
        ;

simple_if:
        IF any_expr THEN
                {}
        DELIMITED
        ;

until:
        /* empty */
        | UNTIL TEXT
        ;

any_expr:
        expr
        | text_expr
        ;

text_expr:
        text EQUALEQUAL text
        | text NOTEQUAL text
        | text_expr ANDAND text_expr
        | text_expr ANDAND expr
        | expr ANDAND text_expr
        | text_expr OROR text_expr
        | text_expr OROR expr
        | expr OROR text_expr
        | '!' text_expr
        ;

optional_by:
        /* empty */
        | BY expr
        | BY '*' expr
        ;

element:
        object_spec
        | LABEL ':' optional_separator element
        | LABEL ':' optional_separator position_not_place
        | LABEL ':' optional_separator place
        | '{' {} element_list '}'
                {}
          optional_element
        | placeless_element
        ;

optional_element:
        /* empty */
        | element
        ;

object_spec:
        BOX
        | CIRCLE
        | ELLIPSE
        | ARC
        | LINE
        | ARROW
        | MOVE
        | SPLINE
        | text                                                  %prec TEXT
        | PLOT expr
        | PLOT expr text
        | '['
                {}
          element_list ']'
        | object_spec HEIGHT expr
        | object_spec RADIUS expr
        | object_spec WIDTH expr
        | object_spec DIAMETER expr
        | object_spec expr                                      %prec HEIGHT
        | object_spec UP
        | object_spec UP expr
        | object_spec DOWN
        | object_spec DOWN expr
        | object_spec RIGHT
        | object_spec RIGHT expr
        | object_spec LEFT
        | object_spec LEFT expr
        | object_spec FROM position
        | object_spec TO position
        | object_spec AT position
        | object_spec WITH path
        | object_spec WITH position                             %prec ','
        | object_spec BY expr_pair
        | object_spec THEN
        | object_spec SOLID
        | object_spec DOTTED
        | object_spec DOTTED expr
        | object_spec DASHED
        | object_spec DASHED expr
        | object_spec FILL
        | object_spec FILL expr
        | object_spec SHADED text
        | object_spec COLORED text
        | object_spec OUTLINED text
        | object_spec CHOP
        | object_spec CHOP expr
        | object_spec SAME
        | object_spec INVISIBLE
        | object_spec LEFT_ARROW_HEAD
        | object_spec RIGHT_ARROW_HEAD
        | object_spec DOUBLE_ARROW_HEAD
        | object_spec CW
        | object_spec CCW
        | object_spec text                                      %prec TEXT
        | object_spec LJUST
        | object_spec RJUST
        | object_spec ABOVE
        | object_spec BELOW
        | object_spec THICKNESS expr
        | object_spec ALIGNED
        ;

text:
        TEXT
        | SPRINTF '(' TEXT sprintf_args ')'
        ;

sprintf_args:
        /* empty */
        | sprintf_args ',' expr
        ;

position:
        position_not_place
        | place
        ;

position_not_place:
        expr_pair
        | position '+' expr_pair
        | position '-' expr_pair
        | '(' position ',' position ')'
        | expr between position AND position
        | expr '<' position ',' position '>'
        ;

between:
        BETWEEN
        | OF THE WAY BETWEEN
        ;

expr_pair:
        expr ',' expr
        | '(' expr_pair ')'
        ;

place:
        /* line at A left == line (at A) left */
        label                                                   %prec CHOP
        | label corner
        | corner label
        | corner OF label
        | HERE
        ;

label:
        LABEL
        | nth_primitive
        | label '.' LABEL
        ;

ordinal:
        ORDINAL
        | '`' any_expr TH
        ;

optional_ordinal_last:
        LAST
        | ordinal LAST
        ;

nth_primitive:
        ordinal object_type
        | optional_ordinal_last object_type
        ;

object_type:
        BOX
        | CIRCLE
        | ELLIPSE
        | ARC
        | LINE
        | ARROW
        | SPLINE
        | '[' ']'
        | TEXT
        ;

label_path:
        '.' LABEL
        | label_path '.' LABEL
        ;

relative_path:
        corner                                                  %prec CHOP
        /* give this a lower precedence than LEFT and RIGHT so that
           [A: box] with .A left == [A: box] with (.A left) */
        | label_path                                            %prec TEXT
        | label_path corner
        ;

path:
        relative_path
        | '(' relative_path ',' relative_path ')'
                {}
        /* The rest of these rules are a compatibility sop. */
        | ORDINAL LAST object_type relative_path
        | LAST object_type relative_path
        | ORDINAL object_type relative_path
        | LABEL relative_path
        ;

corner:
        DOT_N
        | DOT_E
        | DOT_W
        | DOT_S
        | DOT_NE
        | DOT_SE
        | DOT_NW
        | DOT_SW
        | DOT_C
        | DOT_START
        | DOT_END
        | TOP
        | BOTTOM
        | LEFT
        | RIGHT
        | UPPER LEFT
        | LOWER LEFT
        | UPPER RIGHT
        | LOWER RIGHT
        | LEFT_CORNER
        | RIGHT_CORNER
        | UPPER LEFT_CORNER
        | LOWER LEFT_CORNER
        | UPPER RIGHT_CORNER
        | LOWER RIGHT_CORNER
        | NORTH
        | SOUTH
        | EAST
        | WEST
        | CENTER
        | START
        | END
        ;

expr:
        VARIABLE
        | NUMBER
        | place DOT_X
        | place DOT_Y
        | place DOT_HT
        | place DOT_WID
        | place DOT_RAD
        | expr '+' expr
        | expr '-' expr
        | expr '*' expr
        | expr '/' expr
        | expr '%' expr
        | expr '^' expr
        | '-' expr                                              %prec '!'
        | '(' any_expr ')'
        | SIN '(' any_expr ')'
        | COS '(' any_expr ')'
        | ATAN2 '(' any_expr ',' any_expr ')'
        | LOG '(' any_expr ')'
        | EXP '(' any_expr ')'
        | SQRT '(' any_expr ')'
        | K_MAX '(' any_expr ',' any_expr ')'
        | K_MIN '(' any_expr ',' any_expr ')'
        | INT '(' any_expr ')'
        | RAND '(' any_expr ')'
        | RAND '(' ')'
        | SRAND '(' any_expr ')'
        | expr '<' expr
        | expr LESSEQUAL expr
        | expr '>' expr
        | expr GREATEREQUAL expr
        | expr EQUALEQUAL expr
        | expr NOTEQUAL expr
        | expr ANDAND expr
        | expr OROR expr
        | '!' expr
        ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    VARIABLE, '=', LABEL, LEFT, DOT_X, 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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:1461: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:202.19: warning: empty rule without %empty [-Wempty-rule]
input.y:270.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.12: warning: empty rule without %empty [-Wempty-rule]
input.y:309.17: warning: empty rule without %empty [-Wempty-rule]
input.y:382.13: warning: empty rule without %empty [-Wempty-rule]
input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother]
input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence]
input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence]
input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence]
input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence]
input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence]
input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:202.19: warning: empty rule without %empty [-Wempty-rule]
input.y:270.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.12: warning: empty rule without %empty [-Wempty-rule]
input.y:309.17: warning: empty rule without %empty [-Wempty-rule]
input.y:382.13: warning: empty rule without %empty [-Wempty-rule]
input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother]
input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence]
input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence]
input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence]
input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence]
input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence]
input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:1461: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1461"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "422
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461: diff -u /dev/null /dev/null || exit 77"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; diff -u /dev/null /dev/null || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1461"
( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input-lalr.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:1461: bison -fno-caret --report=all input-lalr.y"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; bison -fno-caret --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461: diff -u input-lalr.output input.output \\
           | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1461"
( $at_check_trace; diff -u input-lalr.output input.output \
           | sed -n '/^@@/,$p' | sed 's/^ $//'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/existing.at:1461: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1461"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:1461: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected LEFT
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:1461' \
  "GNU pic (Groff 1.18.1) Grammar: IELR(1)" "        " 17
at_xfail=no
(
  $as_echo "385. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type ielr
%error-verbose

%token LABEL
%token VARIABLE
%token NUMBER
%token TEXT
%token COMMAND_LINE
%token DELIMITED
%token ORDINAL
%token TH
%token LEFT_ARROW_HEAD
%token RIGHT_ARROW_HEAD
%token DOUBLE_ARROW_HEAD
%token LAST
%token UP
%token DOWN
%token LEFT
%token RIGHT
%token BOX
%token CIRCLE
%token ELLIPSE
%token ARC
%token LINE
%token ARROW
%token MOVE
%token SPLINE
%token HEIGHT
%token RADIUS
%token WIDTH
%token DIAMETER
%token FROM
%token TO
%token AT
%token WITH
%token BY
%token THEN
%token SOLID
%token DOTTED
%token DASHED
%token CHOP
%token SAME
%token INVISIBLE
%token LJUST
%token RJUST
%token ABOVE
%token BELOW
%token OF
%token THE
%token WAY
%token BETWEEN
%token AND
%token HERE
%token DOT_N
%token DOT_E
%token DOT_W
%token DOT_S
%token DOT_NE
%token DOT_SE
%token DOT_NW
%token DOT_SW
%token DOT_C
%token DOT_START
%token DOT_END
%token DOT_X
%token DOT_Y
%token DOT_HT
%token DOT_WID
%token DOT_RAD
%token SIN
%token COS
%token ATAN2
%token LOG
%token EXP
%token SQRT
%token K_MAX
%token K_MIN
%token INT
%token RAND
%token SRAND
%token COPY
%token THROUGH
%token TOP
%token BOTTOM
%token UPPER
%token LOWER
%token SH
%token PRINT
%token CW
%token CCW
%token FOR
%token DO
%token IF
%token ELSE
%token ANDAND
%token OROR
%token NOTEQUAL
%token EQUALEQUAL
%token LESSEQUAL
%token GREATEREQUAL
%token LEFT_CORNER
%token RIGHT_CORNER
%token NORTH
%token SOUTH
%token EAST
%token WEST
%token CENTER
%token END
%token START
%token RESET
%token UNTIL
%token PLOT
%token THICKNESS
%token FILL
%token COLORED
%token OUTLINED
%token SHADED
%token ALIGNED
%token SPRINTF
%token COMMAND

%left '.'

/* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
%left PLOT
%left TEXT SPRINTF

/* give text adjustments higher precedence than TEXT, so that
box "foo" above ljust == box ("foo" above ljust)
*/

%left LJUST RJUST ABOVE BELOW

%left LEFT RIGHT
/* Give attributes that take an optional expression a higher
precedence than left and right, so that eg 'line chop left'
parses properly. */
%left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
%left LABEL

%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
%left ORDINAL HERE '`'

%left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */

/* these need to be lower than '-' */
%left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS

/* these must have higher precedence than CHOP so that 'label %prec CHOP'
works */
%left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
%left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
%left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END

%left ','
%left OROR
%left ANDAND
%left EQUALEQUAL NOTEQUAL
%left '<' '>' LESSEQUAL GREATEREQUAL

%left BETWEEN OF
%left AND

%left '+' '-'
%left '*' '/' '%'
%right '!'
%right '^'


%%


top:
        optional_separator
        | element_list
        ;

element_list:
        optional_separator middle_element_list optional_separator
        ;

middle_element_list:
        element
        | middle_element_list separator element
        ;

optional_separator:
        /* empty */
        | separator
        ;

separator:
        ';'
        | separator ';'
        ;

placeless_element:
        VARIABLE '=' any_expr
        | VARIABLE ':' '=' any_expr
        | UP
        | DOWN
        | LEFT
        | RIGHT
        | COMMAND_LINE
        | COMMAND print_args
        | PRINT print_args
        | SH
                {}
          DELIMITED
        | COPY TEXT
        | COPY TEXT THROUGH
                {}
          DELIMITED
                {}
          until
        | COPY THROUGH
                {}
          DELIMITED
                {}
          until
        | FOR VARIABLE '=' expr TO expr optional_by DO
                {}
          DELIMITED
        | simple_if
        | simple_if ELSE
                {}
          DELIMITED
        | reset_variables
        | RESET
        ;

reset_variables:
        RESET VARIABLE
        | reset_variables VARIABLE
        | reset_variables ',' VARIABLE
        ;

print_args:
        print_arg
        | print_args print_arg
        ;

print_arg:
        expr                                                    %prec ','
        | text
        | position                                              %prec ','
        ;

simple_if:
        IF any_expr THEN
                {}
        DELIMITED
        ;

until:
        /* empty */
        | UNTIL TEXT
        ;

any_expr:
        expr
        | text_expr
        ;

text_expr:
        text EQUALEQUAL text
        | text NOTEQUAL text
        | text_expr ANDAND text_expr
        | text_expr ANDAND expr
        | expr ANDAND text_expr
        | text_expr OROR text_expr
        | text_expr OROR expr
        | expr OROR text_expr
        | '!' text_expr
        ;

optional_by:
        /* empty */
        | BY expr
        | BY '*' expr
        ;

element:
        object_spec
        | LABEL ':' optional_separator element
        | LABEL ':' optional_separator position_not_place
        | LABEL ':' optional_separator place
        | '{' {} element_list '}'
                {}
          optional_element
        | placeless_element
        ;

optional_element:
        /* empty */
        | element
        ;

object_spec:
        BOX
        | CIRCLE
        | ELLIPSE
        | ARC
        | LINE
        | ARROW
        | MOVE
        | SPLINE
        | text                                                  %prec TEXT
        | PLOT expr
        | PLOT expr text
        | '['
                {}
          element_list ']'
        | object_spec HEIGHT expr
        | object_spec RADIUS expr
        | object_spec WIDTH expr
        | object_spec DIAMETER expr
        | object_spec expr                                      %prec HEIGHT
        | object_spec UP
        | object_spec UP expr
        | object_spec DOWN
        | object_spec DOWN expr
        | object_spec RIGHT
        | object_spec RIGHT expr
        | object_spec LEFT
        | object_spec LEFT expr
        | object_spec FROM position
        | object_spec TO position
        | object_spec AT position
        | object_spec WITH path
        | object_spec WITH position                             %prec ','
        | object_spec BY expr_pair
        | object_spec THEN
        | object_spec SOLID
        | object_spec DOTTED
        | object_spec DOTTED expr
        | object_spec DASHED
        | object_spec DASHED expr
        | object_spec FILL
        | object_spec FILL expr
        | object_spec SHADED text
        | object_spec COLORED text
        | object_spec OUTLINED text
        | object_spec CHOP
        | object_spec CHOP expr
        | object_spec SAME
        | object_spec INVISIBLE
        | object_spec LEFT_ARROW_HEAD
        | object_spec RIGHT_ARROW_HEAD
        | object_spec DOUBLE_ARROW_HEAD
        | object_spec CW
        | object_spec CCW
        | object_spec text                                      %prec TEXT
        | object_spec LJUST
        | object_spec RJUST
        | object_spec ABOVE
        | object_spec BELOW
        | object_spec THICKNESS expr
        | object_spec ALIGNED
        ;

text:
        TEXT
        | SPRINTF '(' TEXT sprintf_args ')'
        ;

sprintf_args:
        /* empty */
        | sprintf_args ',' expr
        ;

position:
        position_not_place
        | place
        ;

position_not_place:
        expr_pair
        | position '+' expr_pair
        | position '-' expr_pair
        | '(' position ',' position ')'
        | expr between position AND position
        | expr '<' position ',' position '>'
        ;

between:
        BETWEEN
        | OF THE WAY BETWEEN
        ;

expr_pair:
        expr ',' expr
        | '(' expr_pair ')'
        ;

place:
        /* line at A left == line (at A) left */
        label                                                   %prec CHOP
        | label corner
        | corner label
        | corner OF label
        | HERE
        ;

label:
        LABEL
        | nth_primitive
        | label '.' LABEL
        ;

ordinal:
        ORDINAL
        | '`' any_expr TH
        ;

optional_ordinal_last:
        LAST
        | ordinal LAST
        ;

nth_primitive:
        ordinal object_type
        | optional_ordinal_last object_type
        ;

object_type:
        BOX
        | CIRCLE
        | ELLIPSE
        | ARC
        | LINE
        | ARROW
        | SPLINE
        | '[' ']'
        | TEXT
        ;

label_path:
        '.' LABEL
        | label_path '.' LABEL
        ;

relative_path:
        corner                                                  %prec CHOP
        /* give this a lower precedence than LEFT and RIGHT so that
           [A: box] with .A left == [A: box] with (.A left) */
        | label_path                                            %prec TEXT
        | label_path corner
        ;

path:
        relative_path
        | '(' relative_path ',' relative_path ')'
                {}
        /* The rest of these rules are a compatibility sop. */
        | ORDINAL LAST object_type relative_path
        | LAST object_type relative_path
        | ORDINAL object_type relative_path
        | LABEL relative_path
        ;

corner:
        DOT_N
        | DOT_E
        | DOT_W
        | DOT_S
        | DOT_NE
        | DOT_SE
        | DOT_NW
        | DOT_SW
        | DOT_C
        | DOT_START
        | DOT_END
        | TOP
        | BOTTOM
        | LEFT
        | RIGHT
        | UPPER LEFT
        | LOWER LEFT
        | UPPER RIGHT
        | LOWER RIGHT
        | LEFT_CORNER
        | RIGHT_CORNER
        | UPPER LEFT_CORNER
        | LOWER LEFT_CORNER
        | UPPER RIGHT_CORNER
        | LOWER RIGHT_CORNER
        | NORTH
        | SOUTH
        | EAST
        | WEST
        | CENTER
        | START
        | END
        ;

expr:
        VARIABLE
        | NUMBER
        | place DOT_X
        | place DOT_Y
        | place DOT_HT
        | place DOT_WID
        | place DOT_RAD
        | expr '+' expr
        | expr '-' expr
        | expr '*' expr
        | expr '/' expr
        | expr '%' expr
        | expr '^' expr
        | '-' expr                                              %prec '!'
        | '(' any_expr ')'
        | SIN '(' any_expr ')'
        | COS '(' any_expr ')'
        | ATAN2 '(' any_expr ',' any_expr ')'
        | LOG '(' any_expr ')'
        | EXP '(' any_expr ')'
        | SQRT '(' any_expr ')'
        | K_MAX '(' any_expr ',' any_expr ')'
        | K_MIN '(' any_expr ',' any_expr ')'
        | INT '(' any_expr ')'
        | RAND '(' any_expr ')'
        | RAND '(' ')'
        | SRAND '(' any_expr ')'
        | expr '<' expr
        | expr LESSEQUAL expr
        | expr '>' expr
        | expr GREATEREQUAL expr
        | expr EQUALEQUAL expr
        | expr NOTEQUAL expr
        | expr ANDAND expr
        | expr OROR expr
        | '!' expr
        ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    VARIABLE, '=', LABEL, LEFT, DOT_X, 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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:1461: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:202.19: warning: empty rule without %empty [-Wempty-rule]
input.y:270.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.12: warning: empty rule without %empty [-Wempty-rule]
input.y:309.17: warning: empty rule without %empty [-Wempty-rule]
input.y:382.13: warning: empty rule without %empty [-Wempty-rule]
input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother]
input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence]
input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence]
input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence]
input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence]
input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence]
input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:202.19: warning: empty rule without %empty [-Wempty-rule]
input.y:270.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.12: warning: empty rule without %empty [-Wempty-rule]
input.y:309.17: warning: empty rule without %empty [-Wempty-rule]
input.y:382.13: warning: empty rule without %empty [-Wempty-rule]
input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother]
input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence]
input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence]
input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence]
input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence]
input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence]
input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:1461: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1461"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "427
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461: diff -u /dev/null /dev/null || exit 77"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; diff -u /dev/null /dev/null || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed 's/^%define lr.type .*\$//' input.y > input-lalr.y"
at_fn_check_prepare_dynamic "sed 's/^%define lr.type .*$//' input.y > input-lalr.y" "existing.at:1461"
( $at_check_trace; sed 's/^%define lr.type .*$//' input.y > input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input-lalr.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/existing.at:1461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/existing.at:1461: bison -fno-caret --report=all input-lalr.y"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; bison -fno-caret --report=all input-lalr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461: diff -u input-lalr.output input.output \\
           | sed -n '/^@@/,\$p' | sed 's/^ \$//'"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1461"
( $at_check_trace; diff -u input-lalr.output input.output \
           | sed -n '/^@@/,$p' | sed 's/^ $//'
) >>"$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"; $as_echo "@@ -1223,7 +1223,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -1377,7 +1377,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -1854,7 +1854,7 @@

     text                   go to state 162
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -2047,7 +2047,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -2571,7 +2571,7 @@
     position_not_place     go to state 99
     expr_pair              go to state 191
     place                  go to state 101
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -2732,7 +2732,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -2875,7 +2875,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -3018,7 +3018,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -3256,7 +3256,7 @@

 State 102

-  146 place: label .  [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', ',', '>', '+', '-', '!', ';', '}', ']', ')']
+  146 place: label .  [\$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '\`', '+', '-', '!', ';', '}', ']']
   147      | label . corner
   153 label: label . '.' LABEL
   180 corner: . DOT_N
@@ -3645,7 +3645,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -3804,7 +3804,7 @@
     text_expr              go to state 239
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -4481,7 +4481,7 @@
     \$default  reduce using rule 89 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -4673,7 +4673,7 @@
     \$default  reduce using rule 91 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -4867,7 +4867,7 @@
     \$default  reduce using rule 95 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -5065,7 +5065,7 @@
     \$default  reduce using rule 93 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -5260,7 +5260,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -5403,7 +5403,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -5546,7 +5546,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -5689,7 +5689,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -6475,7 +6475,7 @@

     expr_pair              go to state 280
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -6633,7 +6633,7 @@
     \$default  reduce using rule 105 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -6825,7 +6825,7 @@
     \$default  reduce using rule 107 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -7017,7 +7017,7 @@
     \$default  reduce using rule 114 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -7264,7 +7264,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -7408,7 +7408,7 @@
     \$default  reduce using rule 109 (object_spec)

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -7819,12 +7819,12 @@
     position_not_place     go to state 296
     expr_pair              go to state 100
     place                  go to state 297
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
     corner                 go to state 106
-    expr                   go to state 266
+    expr                   go to state 424


 State 165
@@ -7987,7 +7987,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -8172,7 +8172,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -8333,7 +8333,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -8494,7 +8494,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -8655,7 +8655,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -8816,7 +8816,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -8977,7 +8977,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -9138,7 +9138,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -9299,7 +9299,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -9460,7 +9460,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -9623,7 +9623,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -9784,7 +9784,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -9921,7 +9921,7 @@

     \$default  reduce using rule 47 (any_expr)

-    between  go to state 237
+    between  go to state 425


 State 193
@@ -10152,7 +10152,7 @@

     expr_pair              go to state 317
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -10298,7 +10298,7 @@

     expr_pair              go to state 318
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -10622,7 +10622,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -10765,7 +10765,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -10908,7 +10908,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11051,7 +11051,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11194,7 +11194,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11337,7 +11337,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11480,7 +11480,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11637,7 +11637,7 @@
     position_not_place     go to state 99
     expr_pair              go to state 100
     place                  go to state 101
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11780,7 +11780,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -11923,7 +11923,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -12066,7 +12066,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -12209,7 +12209,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -12352,7 +12352,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -12495,7 +12495,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -12638,7 +12638,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -12794,12 +12794,12 @@
     position_not_place     go to state 99
     expr_pair              go to state 100
     place                  go to state 101
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
     corner                 go to state 106
-    expr                   go to state 266
+    expr                   go to state 424


 State 238
@@ -12937,7 +12937,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -13160,7 +13160,7 @@
     text_expr              go to state 342
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -13319,7 +13319,7 @@
     text_expr              go to state 344
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -13502,7 +13502,7 @@
     text_expr              go to state 348
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -13661,7 +13661,7 @@
     text_expr              go to state 350
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -13804,7 +13804,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -14747,7 +14747,7 @@
     position_not_place     go to state 99
     expr_pair              go to state 191
     place                  go to state 101
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -15074,7 +15074,7 @@
     text                   go to state 113
     expr_pair              go to state 365
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -15693,12 +15693,12 @@
     position_not_place     go to state 99
     expr_pair              go to state 100
     place                  go to state 101
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
     corner                 go to state 106
-    expr                   go to state 266
+    expr                   go to state 424


 State 315
@@ -16124,7 +16124,7 @@

     \$default  reduce using rule 239 (expr)

-    between  go to state 237
+    between  go to state 425

     Conflict between rule 239 and token OF resolved as shift ('<' < OF).
     Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN).
@@ -17234,7 +17234,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -17416,7 +17416,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -17577,7 +17577,7 @@
     text_expr              go to state 112
     text                   go to state 113
     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -17772,12 +17772,12 @@
     position_not_place     go to state 99
     expr_pair              go to state 100
     place                  go to state 101
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
     corner                 go to state 106
-    expr                   go to state 266
+    expr                   go to state 424


 State 383
@@ -18071,7 +18071,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -18221,7 +18221,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -18830,7 +18830,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -18987,7 +18987,7 @@
     '!'           shift, and go to state 94

     place                  go to state 114
-    label                  go to state 102
+    label                  go to state 423
     ordinal                go to state 103
     optional_ordinal_last  go to state 104
     nth_primitive          go to state 105
@@ -19089,3 +19089,440 @@
    29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO \$@6 DELIMITED .

     \$default  reduce using rule 29 (placeless_element)
+
+
+State 423
+
+  146 place: label .  [\$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', ']', ')']
+  147      | label . corner
+  153 label: label . '.' LABEL
+  180 corner: . DOT_N
+  181       | . DOT_E
+  182       | . DOT_W
+  183       | . DOT_S
+  184       | . DOT_NE
+  185       | . DOT_SE
+  186       | . DOT_NW
+  187       | . DOT_SW
+  188       | . DOT_C
+  189       | . DOT_START
+  190       | . DOT_END
+  191       | . TOP
+  192       | . BOTTOM
+  193       | . LEFT
+  194       | . RIGHT
+  195       | . UPPER LEFT
+  196       | . LOWER LEFT
+  197       | . UPPER RIGHT
+  198       | . LOWER RIGHT
+  199       | . LEFT_CORNER
+  200       | . RIGHT_CORNER
+  201       | . UPPER LEFT_CORNER
+  202       | . LOWER LEFT_CORNER
+  203       | . UPPER RIGHT_CORNER
+  204       | . LOWER RIGHT_CORNER
+  205       | . NORTH
+  206       | . SOUTH
+  207       | . EAST
+  208       | . WEST
+  209       | . CENTER
+  210       | . START
+  211       | . END
+
+    LEFT          shift, and go to state 53
+    RIGHT         shift, and go to state 54
+    DOT_N         shift, and go to state 56
+    DOT_E         shift, and go to state 57
+    DOT_W         shift, and go to state 58
+    DOT_S         shift, and go to state 59
+    DOT_NE        shift, and go to state 60
+    DOT_SE        shift, and go to state 61
+    DOT_NW        shift, and go to state 62
+    DOT_SW        shift, and go to state 63
+    DOT_C         shift, and go to state 64
+    DOT_START     shift, and go to state 65
+    DOT_END       shift, and go to state 66
+    TOP           shift, and go to state 78
+    BOTTOM        shift, and go to state 79
+    UPPER         shift, and go to state 80
+    LOWER         shift, and go to state 81
+    LEFT_CORNER   shift, and go to state 82
+    RIGHT_CORNER  shift, and go to state 83
+    NORTH         shift, and go to state 84
+    SOUTH         shift, and go to state 85
+    EAST          shift, and go to state 86
+    WEST          shift, and go to state 87
+    CENTER        shift, and go to state 88
+    END           shift, and go to state 89
+    START         shift, and go to state 90
+    '.'           shift, and go to state 204
+
+    \$default  reduce using rule 146 (place)
+
+    corner  go to state 205
+
+
+State 424
+
+  140 position_not_place: expr . between position AND position
+  141                   | expr . '<' position ',' position '>'
+  142 between: . BETWEEN
+  143        | . OF THE WAY BETWEEN
+  144 expr_pair: expr . ',' expr
+  219 expr: expr . '+' expr
+  220     | expr . '-' expr
+  221     | expr . '*' expr
+  222     | expr . '/' expr
+  223     | expr . '%' expr
+  224     | expr . '^' expr
+  239     | expr . '<' expr
+  240     | expr . LESSEQUAL expr
+  241     | expr . '>' expr
+  242     | expr . GREATEREQUAL expr
+  243     | expr . EQUALEQUAL expr
+  244     | expr . NOTEQUAL expr
+  245     | expr . ANDAND expr
+  246     | expr . OROR expr
+
+    OF            shift, and go to state 220
+    BETWEEN       shift, and go to state 221
+    ANDAND        shift, and go to state 222
+    OROR          shift, and go to state 223
+    NOTEQUAL      shift, and go to state 224
+    EQUALEQUAL    shift, and go to state 225
+    LESSEQUAL     shift, and go to state 226
+    GREATEREQUAL  shift, and go to state 227
+    ','           shift, and go to state 228
+    '<'           shift, and go to state 229
+    '>'           shift, and go to state 230
+    '+'           shift, and go to state 231
+    '-'           shift, and go to state 232
+    '*'           shift, and go to state 233
+    '/'           shift, and go to state 234
+    '%'           shift, and go to state 235
+    '^'           shift, and go to state 236
+
+    between  go to state 425
+
+
+State 425
+
+  134 position: . position_not_place
+  135         | . place
+  136 position_not_place: . expr_pair
+  137                   | . position '+' expr_pair
+  138                   | . position '-' expr_pair
+  139                   | . '(' position ',' position ')'
+  140                   | . expr between position AND position
+  140                   | expr between . position AND position
+  141                   | . expr '<' position ',' position '>'
+  144 expr_pair: . expr ',' expr
+  145          | . '(' expr_pair ')'
+  146 place: . label
+  147      | . label corner
+  148      | . corner label
+  149      | . corner OF label
+  150      | . HERE
+  151 label: . LABEL
+  152      | . nth_primitive
+  153      | . label '.' LABEL
+  154 ordinal: . ORDINAL
+  155        | . '\`' any_expr TH
+  156 optional_ordinal_last: . LAST
+  157                      | . ordinal LAST
+  158 nth_primitive: . ordinal object_type
+  159              | . optional_ordinal_last object_type
+  180 corner: . DOT_N
+  181       | . DOT_E
+  182       | . DOT_W
+  183       | . DOT_S
+  184       | . DOT_NE
+  185       | . DOT_SE
+  186       | . DOT_NW
+  187       | . DOT_SW
+  188       | . DOT_C
+  189       | . DOT_START
+  190       | . DOT_END
+  191       | . TOP
+  192       | . BOTTOM
+  193       | . LEFT
+  194       | . RIGHT
+  195       | . UPPER LEFT
+  196       | . LOWER LEFT
+  197       | . UPPER RIGHT
+  198       | . LOWER RIGHT
+  199       | . LEFT_CORNER
+  200       | . RIGHT_CORNER
+  201       | . UPPER LEFT_CORNER
+  202       | . LOWER LEFT_CORNER
+  203       | . UPPER RIGHT_CORNER
+  204       | . LOWER RIGHT_CORNER
+  205       | . NORTH
+  206       | . SOUTH
+  207       | . EAST
+  208       | . WEST
+  209       | . CENTER
+  210       | . START
+  211       | . END
+  212 expr: . VARIABLE
+  213     | . NUMBER
+  214     | . place DOT_X
+  215     | . place DOT_Y
+  216     | . place DOT_HT
+  217     | . place DOT_WID
+  218     | . place DOT_RAD
+  219     | . expr '+' expr
+  220     | . expr '-' expr
+  221     | . expr '*' expr
+  222     | . expr '/' expr
+  223     | . expr '%' expr
+  224     | . expr '^' expr
+  225     | . '-' expr
+  226     | . '(' any_expr ')'
+  227     | . SIN '(' any_expr ')'
+  228     | . COS '(' any_expr ')'
+  229     | . ATAN2 '(' any_expr ',' any_expr ')'
+  230     | . LOG '(' any_expr ')'
+  231     | . EXP '(' any_expr ')'
+  232     | . SQRT '(' any_expr ')'
+  233     | . K_MAX '(' any_expr ',' any_expr ')'
+  234     | . K_MIN '(' any_expr ',' any_expr ')'
+  235     | . INT '(' any_expr ')'
+  236     | . RAND '(' any_expr ')'
+  237     | . RAND '(' ')'
+  238     | . SRAND '(' any_expr ')'
+  239     | . expr '<' expr
+  240     | . expr LESSEQUAL expr
+  241     | . expr '>' expr
+  242     | . expr GREATEREQUAL expr
+  243     | . expr EQUALEQUAL expr
+  244     | . expr NOTEQUAL expr
+  245     | . expr ANDAND expr
+  246     | . expr OROR expr
+  247     | . '!' expr
+
+    LABEL         shift, and go to state 48
+    VARIABLE      shift, and go to state 49
+    NUMBER        shift, and go to state 50
+    ORDINAL       shift, and go to state 51
+    LAST          shift, and go to state 52
+    LEFT          shift, and go to state 53
+    RIGHT         shift, and go to state 54
+    HERE          shift, and go to state 55
+    DOT_N         shift, and go to state 56
+    DOT_E         shift, and go to state 57
+    DOT_W         shift, and go to state 58
+    DOT_S         shift, and go to state 59
+    DOT_NE        shift, and go to state 60
+    DOT_SE        shift, and go to state 61
+    DOT_NW        shift, and go to state 62
+    DOT_SW        shift, and go to state 63
+    DOT_C         shift, and go to state 64
+    DOT_START     shift, and go to state 65
+    DOT_END       shift, and go to state 66
+    SIN           shift, and go to state 67
+    COS           shift, and go to state 68
+    ATAN2         shift, and go to state 69
+    LOG           shift, and go to state 70
+    EXP           shift, and go to state 71
+    SQRT          shift, and go to state 72
+    K_MAX         shift, and go to state 73
+    K_MIN         shift, and go to state 74
+    INT           shift, and go to state 75
+    RAND          shift, and go to state 76
+    SRAND         shift, and go to state 77
+    TOP           shift, and go to state 78
+    BOTTOM        shift, and go to state 79
+    UPPER         shift, and go to state 80
+    LOWER         shift, and go to state 81
+    LEFT_CORNER   shift, and go to state 82
+    RIGHT_CORNER  shift, and go to state 83
+    NORTH         shift, and go to state 84
+    SOUTH         shift, and go to state 85
+    EAST          shift, and go to state 86
+    WEST          shift, and go to state 87
+    CENTER        shift, and go to state 88
+    END           shift, and go to state 89
+    START         shift, and go to state 90
+    '('           shift, and go to state 91
+    '\`'           shift, and go to state 92
+    '-'           shift, and go to state 93
+    '!'           shift, and go to state 94
+
+    position               go to state 426
+    position_not_place     go to state 99
+    expr_pair              go to state 100
+    place                  go to state 101
+    label                  go to state 423
+    ordinal                go to state 103
+    optional_ordinal_last  go to state 104
+    nth_primitive          go to state 105
+    corner                 go to state 106
+    expr                   go to state 424
+
+
+State 426
+
+  137 position_not_place: position . '+' expr_pair
+  138                   | position . '-' expr_pair
+  140                   | expr between position . AND position
+
+    AND  shift, and go to state 427
+    '+'  shift, and go to state 197
+    '-'  shift, and go to state 198
+
+
+State 427
+
+  134 position: . position_not_place
+  135         | . place
+  136 position_not_place: . expr_pair
+  137                   | . position '+' expr_pair
+  138                   | . position '-' expr_pair
+  139                   | . '(' position ',' position ')'
+  140                   | . expr between position AND position
+  140                   | expr between position AND . position
+  141                   | . expr '<' position ',' position '>'
+  144 expr_pair: . expr ',' expr
+  145          | . '(' expr_pair ')'
+  146 place: . label
+  147      | . label corner
+  148      | . corner label
+  149      | . corner OF label
+  150      | . HERE
+  151 label: . LABEL
+  152      | . nth_primitive
+  153      | . label '.' LABEL
+  154 ordinal: . ORDINAL
+  155        | . '\`' any_expr TH
+  156 optional_ordinal_last: . LAST
+  157                      | . ordinal LAST
+  158 nth_primitive: . ordinal object_type
+  159              | . optional_ordinal_last object_type
+  180 corner: . DOT_N
+  181       | . DOT_E
+  182       | . DOT_W
+  183       | . DOT_S
+  184       | . DOT_NE
+  185       | . DOT_SE
+  186       | . DOT_NW
+  187       | . DOT_SW
+  188       | . DOT_C
+  189       | . DOT_START
+  190       | . DOT_END
+  191       | . TOP
+  192       | . BOTTOM
+  193       | . LEFT
+  194       | . RIGHT
+  195       | . UPPER LEFT
+  196       | . LOWER LEFT
+  197       | . UPPER RIGHT
+  198       | . LOWER RIGHT
+  199       | . LEFT_CORNER
+  200       | . RIGHT_CORNER
+  201       | . UPPER LEFT_CORNER
+  202       | . LOWER LEFT_CORNER
+  203       | . UPPER RIGHT_CORNER
+  204       | . LOWER RIGHT_CORNER
+  205       | . NORTH
+  206       | . SOUTH
+  207       | . EAST
+  208       | . WEST
+  209       | . CENTER
+  210       | . START
+  211       | . END
+  212 expr: . VARIABLE
+  213     | . NUMBER
+  214     | . place DOT_X
+  215     | . place DOT_Y
+  216     | . place DOT_HT
+  217     | . place DOT_WID
+  218     | . place DOT_RAD
+  219     | . expr '+' expr
+  220     | . expr '-' expr
+  221     | . expr '*' expr
+  222     | . expr '/' expr
+  223     | . expr '%' expr
+  224     | . expr '^' expr
+  225     | . '-' expr
+  226     | . '(' any_expr ')'
+  227     | . SIN '(' any_expr ')'
+  228     | . COS '(' any_expr ')'
+  229     | . ATAN2 '(' any_expr ',' any_expr ')'
+  230     | . LOG '(' any_expr ')'
+  231     | . EXP '(' any_expr ')'
+  232     | . SQRT '(' any_expr ')'
+  233     | . K_MAX '(' any_expr ',' any_expr ')'
+  234     | . K_MIN '(' any_expr ',' any_expr ')'
+  235     | . INT '(' any_expr ')'
+  236     | . RAND '(' any_expr ')'
+  237     | . RAND '(' ')'
+  238     | . SRAND '(' any_expr ')'
+  239     | . expr '<' expr
+  240     | . expr LESSEQUAL expr
+  241     | . expr '>' expr
+  242     | . expr GREATEREQUAL expr
+  243     | . expr EQUALEQUAL expr
+  244     | . expr NOTEQUAL expr
+  245     | . expr ANDAND expr
+  246     | . expr OROR expr
+  247     | . '!' expr
+
+    LABEL         shift, and go to state 48
+    VARIABLE      shift, and go to state 49
+    NUMBER        shift, and go to state 50
+    ORDINAL       shift, and go to state 51
+    LAST          shift, and go to state 52
+    LEFT          shift, and go to state 53
+    RIGHT         shift, and go to state 54
+    HERE          shift, and go to state 55
+    DOT_N         shift, and go to state 56
+    DOT_E         shift, and go to state 57
+    DOT_W         shift, and go to state 58
+    DOT_S         shift, and go to state 59
+    DOT_NE        shift, and go to state 60
+    DOT_SE        shift, and go to state 61
+    DOT_NW        shift, and go to state 62
+    DOT_SW        shift, and go to state 63
+    DOT_C         shift, and go to state 64
+    DOT_START     shift, and go to state 65
+    DOT_END       shift, and go to state 66
+    SIN           shift, and go to state 67
+    COS           shift, and go to state 68
+    ATAN2         shift, and go to state 69
+    LOG           shift, and go to state 70
+    EXP           shift, and go to state 71
+    SQRT          shift, and go to state 72
+    K_MAX         shift, and go to state 73
+    K_MIN         shift, and go to state 74
+    INT           shift, and go to state 75
+    RAND          shift, and go to state 76
+    SRAND         shift, and go to state 77
+    TOP           shift, and go to state 78
+    BOTTOM        shift, and go to state 79
+    UPPER         shift, and go to state 80
+    LOWER         shift, and go to state 81
+    LEFT_CORNER   shift, and go to state 82
+    RIGHT_CORNER  shift, and go to state 83
+    NORTH         shift, and go to state 84
+    SOUTH         shift, and go to state 85
+    EAST          shift, and go to state 86
+    WEST          shift, and go to state 87
+    CENTER        shift, and go to state 88
+    END           shift, and go to state 89
+    START         shift, and go to state 90
+    '('           shift, and go to state 91
+    '\`'           shift, and go to state 92
+    '-'           shift, and go to state 93
+    '!'           shift, and go to state 94
+
+    position               go to state 402
+    position_not_place     go to state 99
+    expr_pair              go to state 100
+    place                  go to state 101
+    label                  go to state 423
+    ordinal                go to state 103
+    optional_ordinal_last  go to state 104
+    nth_primitive          go to state 105
+    corner                 go to state 106
+    expr                   go to state 424
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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 indent the result.

{ set +x
$as_echo "$at_srcdir/existing.at:1461: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1461"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:1461: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; 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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'existing.at:1461' \
  "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 17
at_xfail=no
(
  $as_echo "386. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%define lr.type canonical-lr
%error-verbose

%token LABEL
%token VARIABLE
%token NUMBER
%token TEXT
%token COMMAND_LINE
%token DELIMITED
%token ORDINAL
%token TH
%token LEFT_ARROW_HEAD
%token RIGHT_ARROW_HEAD
%token DOUBLE_ARROW_HEAD
%token LAST
%token UP
%token DOWN
%token LEFT
%token RIGHT
%token BOX
%token CIRCLE
%token ELLIPSE
%token ARC
%token LINE
%token ARROW
%token MOVE
%token SPLINE
%token HEIGHT
%token RADIUS
%token WIDTH
%token DIAMETER
%token FROM
%token TO
%token AT
%token WITH
%token BY
%token THEN
%token SOLID
%token DOTTED
%token DASHED
%token CHOP
%token SAME
%token INVISIBLE
%token LJUST
%token RJUST
%token ABOVE
%token BELOW
%token OF
%token THE
%token WAY
%token BETWEEN
%token AND
%token HERE
%token DOT_N
%token DOT_E
%token DOT_W
%token DOT_S
%token DOT_NE
%token DOT_SE
%token DOT_NW
%token DOT_SW
%token DOT_C
%token DOT_START
%token DOT_END
%token DOT_X
%token DOT_Y
%token DOT_HT
%token DOT_WID
%token DOT_RAD
%token SIN
%token COS
%token ATAN2
%token LOG
%token EXP
%token SQRT
%token K_MAX
%token K_MIN
%token INT
%token RAND
%token SRAND
%token COPY
%token THROUGH
%token TOP
%token BOTTOM
%token UPPER
%token LOWER
%token SH
%token PRINT
%token CW
%token CCW
%token FOR
%token DO
%token IF
%token ELSE
%token ANDAND
%token OROR
%token NOTEQUAL
%token EQUALEQUAL
%token LESSEQUAL
%token GREATEREQUAL
%token LEFT_CORNER
%token RIGHT_CORNER
%token NORTH
%token SOUTH
%token EAST
%token WEST
%token CENTER
%token END
%token START
%token RESET
%token UNTIL
%token PLOT
%token THICKNESS
%token FILL
%token COLORED
%token OUTLINED
%token SHADED
%token ALIGNED
%token SPRINTF
%token COMMAND

%left '.'

/* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
%left PLOT
%left TEXT SPRINTF

/* give text adjustments higher precedence than TEXT, so that
box "foo" above ljust == box ("foo" above ljust)
*/

%left LJUST RJUST ABOVE BELOW

%left LEFT RIGHT
/* Give attributes that take an optional expression a higher
precedence than left and right, so that eg 'line chop left'
parses properly. */
%left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
%left LABEL

%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
%left ORDINAL HERE '`'

%left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */

/* these need to be lower than '-' */
%left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS

/* these must have higher precedence than CHOP so that 'label %prec CHOP'
works */
%left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
%left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
%left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END

%left ','
%left OROR
%left ANDAND
%left EQUALEQUAL NOTEQUAL
%left '<' '>' LESSEQUAL GREATEREQUAL

%left BETWEEN OF
%left AND

%left '+' '-'
%left '*' '/' '%'
%right '!'
%right '^'


%%


top:
        optional_separator
        | element_list
        ;

element_list:
        optional_separator middle_element_list optional_separator
        ;

middle_element_list:
        element
        | middle_element_list separator element
        ;

optional_separator:
        /* empty */
        | separator
        ;

separator:
        ';'
        | separator ';'
        ;

placeless_element:
        VARIABLE '=' any_expr
        | VARIABLE ':' '=' any_expr
        | UP
        | DOWN
        | LEFT
        | RIGHT
        | COMMAND_LINE
        | COMMAND print_args
        | PRINT print_args
        | SH
                {}
          DELIMITED
        | COPY TEXT
        | COPY TEXT THROUGH
                {}
          DELIMITED
                {}
          until
        | COPY THROUGH
                {}
          DELIMITED
                {}
          until
        | FOR VARIABLE '=' expr TO expr optional_by DO
                {}
          DELIMITED
        | simple_if
        | simple_if ELSE
                {}
          DELIMITED
        | reset_variables
        | RESET
        ;

reset_variables:
        RESET VARIABLE
        | reset_variables VARIABLE
        | reset_variables ',' VARIABLE
        ;

print_args:
        print_arg
        | print_args print_arg
        ;

print_arg:
        expr                                                    %prec ','
        | text
        | position                                              %prec ','
        ;

simple_if:
        IF any_expr THEN
                {}
        DELIMITED
        ;

until:
        /* empty */
        | UNTIL TEXT
        ;

any_expr:
        expr
        | text_expr
        ;

text_expr:
        text EQUALEQUAL text
        | text NOTEQUAL text
        | text_expr ANDAND text_expr
        | text_expr ANDAND expr
        | expr ANDAND text_expr
        | text_expr OROR text_expr
        | text_expr OROR expr
        | expr OROR text_expr
        | '!' text_expr
        ;

optional_by:
        /* empty */
        | BY expr
        | BY '*' expr
        ;

element:
        object_spec
        | LABEL ':' optional_separator element
        | LABEL ':' optional_separator position_not_place
        | LABEL ':' optional_separator place
        | '{' {} element_list '}'
                {}
          optional_element
        | placeless_element
        ;

optional_element:
        /* empty */
        | element
        ;

object_spec:
        BOX
        | CIRCLE
        | ELLIPSE
        | ARC
        | LINE
        | ARROW
        | MOVE
        | SPLINE
        | text                                                  %prec TEXT
        | PLOT expr
        | PLOT expr text
        | '['
                {}
          element_list ']'
        | object_spec HEIGHT expr
        | object_spec RADIUS expr
        | object_spec WIDTH expr
        | object_spec DIAMETER expr
        | object_spec expr                                      %prec HEIGHT
        | object_spec UP
        | object_spec UP expr
        | object_spec DOWN
        | object_spec DOWN expr
        | object_spec RIGHT
        | object_spec RIGHT expr
        | object_spec LEFT
        | object_spec LEFT expr
        | object_spec FROM position
        | object_spec TO position
        | object_spec AT position
        | object_spec WITH path
        | object_spec WITH position                             %prec ','
        | object_spec BY expr_pair
        | object_spec THEN
        | object_spec SOLID
        | object_spec DOTTED
        | object_spec DOTTED expr
        | object_spec DASHED
        | object_spec DASHED expr
        | object_spec FILL
        | object_spec FILL expr
        | object_spec SHADED text
        | object_spec COLORED text
        | object_spec OUTLINED text
        | object_spec CHOP
        | object_spec CHOP expr
        | object_spec SAME
        | object_spec INVISIBLE
        | object_spec LEFT_ARROW_HEAD
        | object_spec RIGHT_ARROW_HEAD
        | object_spec DOUBLE_ARROW_HEAD
        | object_spec CW
        | object_spec CCW
        | object_spec text                                      %prec TEXT
        | object_spec LJUST
        | object_spec RJUST
        | object_spec ABOVE
        | object_spec BELOW
        | object_spec THICKNESS expr
        | object_spec ALIGNED
        ;

text:
        TEXT
        | SPRINTF '(' TEXT sprintf_args ')'
        ;

sprintf_args:
        /* empty */
        | sprintf_args ',' expr
        ;

position:
        position_not_place
        | place
        ;

position_not_place:
        expr_pair
        | position '+' expr_pair
        | position '-' expr_pair
        | '(' position ',' position ')'
        | expr between position AND position
        | expr '<' position ',' position '>'
        ;

between:
        BETWEEN
        | OF THE WAY BETWEEN
        ;

expr_pair:
        expr ',' expr
        | '(' expr_pair ')'
        ;

place:
        /* line at A left == line (at A) left */
        label                                                   %prec CHOP
        | label corner
        | corner label
        | corner OF label
        | HERE
        ;

label:
        LABEL
        | nth_primitive
        | label '.' LABEL
        ;

ordinal:
        ORDINAL
        | '`' any_expr TH
        ;

optional_ordinal_last:
        LAST
        | ordinal LAST
        ;

nth_primitive:
        ordinal object_type
        | optional_ordinal_last object_type
        ;

object_type:
        BOX
        | CIRCLE
        | ELLIPSE
        | ARC
        | LINE
        | ARROW
        | SPLINE
        | '[' ']'
        | TEXT
        ;

label_path:
        '.' LABEL
        | label_path '.' LABEL
        ;

relative_path:
        corner                                                  %prec CHOP
        /* give this a lower precedence than LEFT and RIGHT so that
           [A: box] with .A left == [A: box] with (.A left) */
        | label_path                                            %prec TEXT
        | label_path corner
        ;

path:
        relative_path
        | '(' relative_path ',' relative_path ')'
                {}
        /* The rest of these rules are a compatibility sop. */
        | ORDINAL LAST object_type relative_path
        | LAST object_type relative_path
        | ORDINAL object_type relative_path
        | LABEL relative_path
        ;

corner:
        DOT_N
        | DOT_E
        | DOT_W
        | DOT_S
        | DOT_NE
        | DOT_SE
        | DOT_NW
        | DOT_SW
        | DOT_C
        | DOT_START
        | DOT_END
        | TOP
        | BOTTOM
        | LEFT
        | RIGHT
        | UPPER LEFT
        | LOWER LEFT
        | UPPER RIGHT
        | LOWER RIGHT
        | LEFT_CORNER
        | RIGHT_CORNER
        | UPPER LEFT_CORNER
        | LOWER LEFT_CORNER
        | UPPER RIGHT_CORNER
        | LOWER RIGHT_CORNER
        | NORTH
        | SOUTH
        | EAST
        | WEST
        | CENTER
        | START
        | END
        ;

expr:
        VARIABLE
        | NUMBER
        | place DOT_X
        | place DOT_Y
        | place DOT_HT
        | place DOT_WID
        | place DOT_RAD
        | expr '+' expr
        | expr '-' expr
        | expr '*' expr
        | expr '/' expr
        | expr '%' expr
        | expr '^' expr
        | '-' expr                                              %prec '!'
        | '(' any_expr ')'
        | SIN '(' any_expr ')'
        | COS '(' any_expr ')'
        | ATAN2 '(' any_expr ',' any_expr ')'
        | LOG '(' any_expr ')'
        | EXP '(' any_expr ')'
        | SQRT '(' any_expr ')'
        | K_MAX '(' any_expr ',' any_expr ')'
        | K_MIN '(' any_expr ',' any_expr ')'
        | INT '(' any_expr ')'
        | RAND '(' any_expr ')'
        | RAND '(' ')'
        | SRAND '(' any_expr ')'
        | expr '<' expr
        | expr LESSEQUAL expr
        | expr '>' expr
        | expr GREATEREQUAL expr
        | expr EQUALEQUAL expr
        | expr NOTEQUAL expr
        | expr ANDAND expr
        | expr OROR expr
        | '!' expr
        ;


%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static int const input[] = {
    VARIABLE, '=', LABEL, LEFT, DOT_X, 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.

{ set +x
$as_echo "$at_srcdir/existing.at:1461: bison -fno-caret -Wall --report=all --defines -o input.c input.y"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; bison -fno-caret -Wall --report=all --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:202.19: warning: empty rule without %empty [-Wempty-rule]
input.y:270.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.12: warning: empty rule without %empty [-Wempty-rule]
input.y:309.17: warning: empty rule without %empty [-Wempty-rule]
input.y:382.13: warning: empty rule without %empty [-Wempty-rule]
input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother]
input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence]
input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence]
input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence]
input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence]
input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence]
input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:202.19: warning: empty rule without %empty [-Wempty-rule]
input.y:270.6: warning: empty rule without %empty [-Wempty-rule]
input.y:292.12: warning: empty rule without %empty [-Wempty-rule]
input.y:309.17: warning: empty rule without %empty [-Wempty-rule]
input.y:382.13: warning: empty rule without %empty [-Wempty-rule]
input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother]
input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence]
input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence]
input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence]
input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence]
input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence]
input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence]
input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence]
input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence]
input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence]
input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence]
input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence]
input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence]
input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence]
input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence]
input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence]
input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence]
input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence]
input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence]
input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/existing.at:1461: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror" "existing.at:1461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi

{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed -n 's/^State //p' input.output | tail -1"
at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1461"
( $at_check_trace; sed -n 's/^State //p' input.output | tail -1
) >>"$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"; $as_echo "4833
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$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 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
{ set +x
$as_echo "$at_srcdir/existing.at:1461: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "existing.at:1461"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:1461: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:1461:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1461"
( $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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/existing.at:1461: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "existing.at:1461"
( $at_check_trace; 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/existing.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'regression.at:25' \
  "Trivial grammars" "                               " 18
at_xfail=no
(
  $as_echo "387. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *msg);
int yylex (void);
#define YYSTYPE int *
%}

%error-verbose

%%

program: 'x';
_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:43"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:43: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:43"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:43"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:43: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:43"
( $at_check_trace; bison -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/regression.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:44: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:44"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:44: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:44"
( $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/regression.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:45: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:45"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:45: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o -DYYDEBUG -c input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c input.c " "regression.at:45"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o -DYYDEBUG -c 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/regression.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:55' \
  "YYSTYPE typedef" "                                " 18
at_xfail=no
(
  $as_echo "388. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *msg);
int yylex (void);
typedef union { char const *val; } YYSTYPE;
%}

%type <val> program

%%

program: { $$ = ""; };
_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:73"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:73"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:73"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:73: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:73"
( $at_check_trace; bison -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/regression.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:74: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:74"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:74: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:74"
( $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/regression.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_388
#AT_START_389
at_fn_group_banner 389 'regression.at:85' \
  "Early token definitions with --yacc" "            " 18
at_xfail=no
(
  $as_echo "389. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Found in GCJ: they expect the tokens to be defined before the user
# prologue, so that they can use the token definitions in it.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *msg);
int yylex (void);
%}

%union
{
  int val;
};
%{
#ifndef MY_TOKEN
# error "MY_TOKEN not defined."
#endif
%}
%token MY_TOKEN
%%
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
$as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -y -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:113"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -y -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/regression.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:113: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y" "regression.at:113"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -y -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/regression.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:113: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:113"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:113: bison -fno-caret -y -o input.c input.y"
at_fn_check_prepare_trace "regression.at:113"
( $at_check_trace; bison -fno-caret -y -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/regression.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:114: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:114"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:114"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:114: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:114"
( $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/regression.at:114"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:125' \
  "Early token definitions without --yacc" "         " 18
at_xfail=no
(
  $as_echo "390. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Found in GCJ: they expect the tokens to be defined before the user
# prologue, so that they can use the token definitions in it.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *msg);
int yylex (void);
void print_my_token (void);
%}

%union
{
  int val;
};
%{
#include <stdio.h>
void
print_my_token (void)
{
  enum yytokentype my_token = MY_TOKEN;
  printf ("%d\n", my_token);
}
%}
%token MY_TOKEN
%%
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
$as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:158"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:158"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:158: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:158"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:158"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:158: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:158"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:158"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:158: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:158"
( $at_check_trace; bison -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/regression.at:158"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:159: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:159"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:159"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:159: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:159"
( $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/regression.at:159"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:170' \
  "Braces parsing" "                                 " 18
at_xfail=no
(
  $as_echo "391. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
/* Bison used to swallow the character after '}'. */

%%
exp: { tests = {{{{{{{{{{}}}}}}}}}}; };
%%
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:182"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:182: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:182"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:182: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:182"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:182: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:182"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:182: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:182"
( $at_check_trace; bison -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/regression.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:184: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c"
at_fn_check_prepare_trace "regression.at:184"
( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' 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:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:194' \
  "Duplicate string" "                               " 18
at_xfail=no
(
  $as_echo "392. $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
$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:211: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:211"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:211: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:211"
( $at_check_trace; bison -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"; $as_echo "input.y:6.8-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/regression.at:211"
$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
$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Werror" "regression.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:6.8-14: warning: symbol "<=" used more than once as a literal string [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:211: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:211"
( $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/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=error" "regression.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Wnone -Werror" "regression.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:211: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=none -Werror" "regression.at:211"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:211"
$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_392
#AT_START_393
at_fn_group_banner 393 'regression.at:222' \
  "Rule Line Numbers" "                              " 18
at_xfail=no
(
  $as_echo "393. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >input.y <<'_ATEOF'
%%
expr:
'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
$as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c -v input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:258"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c -v input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:258: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y" "regression.at:258"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:258: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:258"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:258"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:258: bison -fno-caret -o input.c -v input.y"
at_fn_check_prepare_trace "regression.at:258"
( $at_check_trace; bison -fno-caret -o input.c -v 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/regression.at:258"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/regression.at:261: cat input.output"
at_fn_check_prepare_trace "regression.at:261"
( $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"; $as_echo "Grammar

    0 \$accept: expr \$end

    1 \$@1: %empty

    2 expr: 'a' \$@1 'b'

    3 \$@2: %empty

    4 expr: \$@2 'c'


Terminals, with rules where they appear

\$end (0) 0
'a' (97) 2
'b' (98) 2
'c' (99) 4
error (256)


Nonterminals, with rules where they appear

\$accept (6)
    on left: 0
expr (7)
    on left: 2 4, on right: 0
\$@1 (8)
    on left: 1, on right: 2
\$@2 (9)
    on left: 3, on right: 4


State 0

    0 \$accept: . expr \$end

    'a'  shift, and go to state 1

    \$default  reduce using rule 3 (\$@2)

    expr  go to state 2
    \$@2   go to state 3


State 1

    2 expr: 'a' . \$@1 'b'

    \$default  reduce using rule 1 (\$@1)

    \$@1  go to state 4


State 2

    0 \$accept: expr . \$end

    \$end  shift, and go to state 5


State 3

    4 expr: \$@2 . 'c'

    'c'  shift, and go to state 6


State 4

    2 expr: 'a' \$@1 . 'b'

    'b'  shift, and go to state 7


State 5

    0 \$accept: expr \$end .

    \$default  accept


State 6

    4 expr: \$@2 'c' .

    \$default  reduce using rule 4 (expr)


State 7

    2 expr: 'a' \$@1 'b' .

    \$default  reduce using rule 2 (expr)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:368' \
  "Mixing %token styles" "                           " 18
at_xfail=no
(
  $as_echo "394. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Taken from the documentation.
cat >input.y <<'_ATEOF'
%token  <operator>  OR      "||"
%token  <operator>  LE 134  "<="
%left  OR  "<="
%%
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
$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -Wall -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:380"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -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/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y" "regression.at:380"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -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/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:380: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:380"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:380: bison -fno-caret -v -Wall -o input.c input.y"
at_fn_check_prepare_trace "regression.at:380"
( $at_check_trace; bison -fno-caret -v -Wall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.1-5: warning: useless precedence and associativity for \"||\" [-Wprecedence]
input.y:3.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/regression.at:380"
$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
$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Werror" "regression.at:380"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -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/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:3.1-5: warning: useless precedence and associativity for "||" [-Wprecedence]
input.y:3.1-5: warning: useless precedence and associativity for "<=" [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:380: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:380"
( $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/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=error" "regression.at:380"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -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/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Wnone -Werror" "regression.at:380"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:380: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror" "regression.at:380"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:380"
$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_394
#AT_START_395
at_fn_group_banner 395 'regression.at:394' \
  "Invalid inputs" "                                 " 18
at_xfail=no
(
  $as_echo "395. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
?
default: 'a' }
%&
%a-does-not-exist
%-
%{
_ATEOF



{ set +x
$as_echo "$at_srcdir/regression.at:406: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "regression.at:406"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.1: error: invalid character: '?'
input.y:3.14: error: invalid character: '}'
input.y:4.1: error: invalid character: '%'
input.y:4.2: error: invalid character: '&'
input.y:5.1-17: error: invalid directive: '%a-does-not-exist'
input.y:6.1: error: invalid character: '%'
input.y:6.2: error: invalid character: '-'
input.y:7.1-8.0: error: missing '%}' at end of file
input.y:7.1-8.0: error: syntax error, unexpected %{...%}
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:406"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:421' \
  "Invalid inputs with {}" "                         " 18
at_xfail=no
(
  $as_echo "396. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'

%destructor
%initial-action
%lex-param
%parse-param
%printer
%union
_ATEOF



{ set +x
$as_echo "$at_srcdir/regression.at:433: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "regression.at:433"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...}
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:446' \
  "Token definitions" "                              " 18
at_xfail=no
(
  $as_echo "397. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Bison managed, when fed with '%token 'f' "f"' to #define 'f'!
cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
%}
%error-verbose
%token MYEOF 0 "end of file"
%token 'a' "a"
%token B_TOKEN "b"
%token C_TOKEN 'c'
%token 'd' D_TOKEN
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
%%
exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static int const input[] = { SPECIAL };
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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




# Checking the warning message guarantees that the trigraph "??!" isn't
# unnecessarily escaped here even though it would need to be if encoded in a
# C-string literal.  Also notice that unnecessary escaping, such as "\?", from
# the user specification is eliminated.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:476: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:476"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:476: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:476"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:476: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:476"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:476: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:476"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:476: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:476"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
input.y:22.8-63: warning: symbol \"\\\\'?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\001\\201??!\" 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/regression.at:476"
$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
$as_echo "$at_srcdir/regression.at:476: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "regression.at:476"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
input.y:22.8-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:476: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:476"
( $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/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:476: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "regression.at:476"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:476: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "regression.at:476"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:476: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "regression.at:476"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$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
$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "regression.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:480: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:480"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:480: bison -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:480"
( $at_check_trace; bison -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"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
 %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\"
        ^^^^^^^
input.y:22.8-63: warning: symbol \"\\\\'?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\001\\201??!\" used more than once as a literal string [-Wother]
 %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
$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
$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Werror" "regression.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
 %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
        ^^^^^^^
input.y:22.8-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
 %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:480: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:480"
( $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/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=error" "regression.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror" "regression.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:480: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror" "regression.at:480"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -fcaret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:488: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:488"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:488: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:488"
( $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/regression.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }


# Checking the error message here guarantees that yytname, which does contain
# C-string literals, does have the trigraph escaped correctly.  Thus, the
# symbol name reported by the parser is exactly the same as that reported by
# Bison itself.
cat >experr <<'_ATEOF'
syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!", expecting a
_ATEOF

{ set +x
$as_echo "$at_srcdir/regression.at:497:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:497"
( $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/regression.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:497: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:497"
( $at_check_trace; 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_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.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_397
#AT_START_398
at_fn_group_banner 398 'regression.at:507' \
  "Characters Escapes" "                             " 18
at_xfail=no
(
  $as_echo "398. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *msg);
int yylex (void);
%}
%%
exp:
  '\'' "\'"
| '\"' "\""
| '"'  "'" /* Pacify font-lock-mode: ". */
;
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:525"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:525"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:525: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:525"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:525: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:525"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:525: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:525"
( $at_check_trace; bison -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/regression.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:526: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:526"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:526: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "regression.at:526"
( $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/regression.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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 'regression.at:540' \
  "Web2c Report" "                                   " 18
at_xfail=no
(
  $as_echo "399. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%token        undef_id_tok const_id_tok

%start CONST_DEC_PART

%%
CONST_DEC_PART:
         CONST_DEC_LIST
        ;

CONST_DEC_LIST:
          CONST_DEC
        | CONST_DEC_LIST CONST_DEC
        ;

CONST_DEC:
          { } undef_id_tok '=' const_id_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
$as_echo "$at_srcdir/regression.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:565"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v input.y" "regression.at:565"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:565: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:565"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:565: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:565"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:565: bison -fno-caret -v input.y"
at_fn_check_prepare_trace "regression.at:565"
( $at_check_trace; bison -fno-caret -v 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/regression.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:566: cat input.output"
at_fn_check_prepare_trace "regression.at:566"
( $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"; $as_echo "Grammar

    0 \$accept: CONST_DEC_PART \$end

    1 CONST_DEC_PART: CONST_DEC_LIST

    2 CONST_DEC_LIST: CONST_DEC
    3               | CONST_DEC_LIST CONST_DEC

    4 \$@1: %empty

    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';'


Terminals, with rules where they appear

\$end (0) 0
';' (59) 5
'=' (61) 5
error (256)
undef_id_tok (258) 5
const_id_tok (259) 5


Nonterminals, with rules where they appear

\$accept (7)
    on left: 0
CONST_DEC_PART (8)
    on left: 1, on right: 0
CONST_DEC_LIST (9)
    on left: 2 3, on right: 1 3
CONST_DEC (10)
    on left: 5, on right: 2 3
\$@1 (11)
    on left: 4, on right: 5


State 0

    0 \$accept: . CONST_DEC_PART \$end

    \$default  reduce using rule 4 (\$@1)

    CONST_DEC_PART  go to state 1
    CONST_DEC_LIST  go to state 2
    CONST_DEC       go to state 3
    \$@1             go to state 4


State 1

    0 \$accept: CONST_DEC_PART . \$end

    \$end  shift, and go to state 5


State 2

    1 CONST_DEC_PART: CONST_DEC_LIST .
    3 CONST_DEC_LIST: CONST_DEC_LIST . CONST_DEC

    undef_id_tok  reduce using rule 4 (\$@1)
    \$default      reduce using rule 1 (CONST_DEC_PART)

    CONST_DEC  go to state 6
    \$@1        go to state 4


State 3

    2 CONST_DEC_LIST: CONST_DEC .

    \$default  reduce using rule 2 (CONST_DEC_LIST)


State 4

    5 CONST_DEC: \$@1 . undef_id_tok '=' const_id_tok ';'

    undef_id_tok  shift, and go to state 7


State 5

    0 \$accept: CONST_DEC_PART \$end .

    \$default  accept


State 6

    3 CONST_DEC_LIST: CONST_DEC_LIST CONST_DEC .

    \$default  reduce using rule 3 (CONST_DEC_LIST)


State 7

    5 CONST_DEC: \$@1 undef_id_tok . '=' const_id_tok ';'

    '='  shift, and go to state 8


State 8

    5 CONST_DEC: \$@1 undef_id_tok '=' . const_id_tok ';'

    const_id_tok  shift, and go to state 9


State 9

    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok . ';'

    ';'  shift, and go to state 10


State 10

    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';' .

    \$default  reduce using rule 5 (CONST_DEC)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:566"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:717' \
  "Web2c Actions" "                                  " 18
at_xfail=no
(
  $as_echo "400. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%%
statement:  struct_stat;
struct_stat:  %empty | if else;
if: "if" "const" "then" statement;
else: "else" statement;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:730: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:730"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:730"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:730: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:730"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:730"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:730: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:730"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:730"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:730: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:730"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:730"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:730: bison -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:730"
( $at_check_trace; bison -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/regression.at:730"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check only the tables.
sed -n 's/  *$//;/^static const.*\[\] =/,/^}/p' input.c >tables.c

{ set +x
$as_echo "$at_srcdir/regression.at:735: cat tables.c"
at_fn_check_prepare_trace "regression.at:735"
( $at_check_trace; cat tables.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"; $as_echo "static const yytype_uint8 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6
};
static const yytype_uint8 yyrline[] =
{
       0,     2,     2,     3,     3,     4,     5
};
static const char *const yytname[] =
{
  \"\$end\", \"error\", \"\$undefined\", \"\\\"if\\\"\", \"\\\"const\\\"\", \"\\\"then\\\"\",
  \"\\\"else\\\"\", \"\$accept\", \"statement\", \"struct_stat\", \"if\", \"else\", YY_NULLPTR
};
static const yytype_uint16 yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261
};
static const yytype_int8 yypact[] =
{
      -2,    -1,     4,    -8,     0,     2,    -8,    -2,    -8,    -2,
      -8,    -8
};
static const yytype_uint8 yydefact[] =
{
       3,     0,     0,     2,     0,     0,     1,     3,     4,     3,
       6,     5
};
static const yytype_int8 yypgoto[] =
{
      -8,    -7,    -8,    -8,    -8
};
static const yytype_int8 yydefgoto[] =
{
      -1,     2,     3,     4,     8
};
static const yytype_uint8 yytable[] =
{
      10,     1,    11,     5,     6,     0,     7,     9
};
static const yytype_int8 yycheck[] =
{
       7,     3,     9,     4,     0,    -1,     6,     5
};
static const yytype_uint8 yystos[] =
{
       0,     3,     8,     9,    10,     4,     0,     6,    11,     5,
       8,     8
};
static const yytype_uint8 yyr1[] =
{
       0,     7,     8,     9,     9,    10,    11
};
static const yytype_uint8 yyr2[] =
{
       0,     2,     1,     0,     2,     4,     2
};
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:735"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:906' \
  "Dancer " "                                        " 18
at_xfail=no
(
  $as_echo "401. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >dancer.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code provides
{
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%token ARROW INVALID NUMBER STRING DATA
%verbose
%error-verbose
/* Grammar follows */
%%
line: header body
   ;

header: '<' from ARROW to '>' type ':'
   | '<' ARROW to '>' type ':'
   | ARROW to type ':'
   | type ':'
   | '<' '>'
   ;

from: DATA
   | STRING
   | INVALID
   ;

to: DATA
   | STRING
   | INVALID
   ;

type: DATA
   | STRING
   | INVALID
   ;

body: %empty
   | body member
   ;

member: STRING
   | DATA
   | '+' NUMBER
   | '-' NUMBER
   | NUMBER
   | INVALID
   ;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = ":";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/regression.at:906: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:906"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:906: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:906"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:906: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:906"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:906: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:906"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:906: bison -fno-caret -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:906"
( $at_check_trace; bison -fno-caret -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:906: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:906"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:906: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:906"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.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/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:906:  \$PREPARSER ./dancer"
at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:906"
( $at_check_trace;  $PREPARSER ./dancer
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:906: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:906"
( $at_check_trace; sed >&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"; $as_echo "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/regression.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:907' \
  "Dancer %glr-parser" "                             " 18
at_xfail=no
(
  $as_echo "402. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >dancer.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code provides
{
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}
%glr-parser
%token ARROW INVALID NUMBER STRING DATA
%verbose
%error-verbose
/* Grammar follows */
%%
line: header body
   ;

header: '<' from ARROW to '>' type ':'
   | '<' ARROW to '>' type ':'
   | ARROW to type ':'
   | type ':'
   | '<' '>'
   ;

from: DATA
   | STRING
   | INVALID
   ;

to: DATA
   | STRING
   | INVALID
   ;

type: DATA
   | STRING
   | INVALID
   ;

body: %empty
   | body member
   ;

member: STRING
   | DATA
   | '+' NUMBER
   | '-' NUMBER
   | NUMBER
   | INVALID
   ;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = ":";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/regression.at:907: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:907"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:907: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:907"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:907: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:907"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:907: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:907"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:907: bison -fno-caret -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:907"
( $at_check_trace; bison -fno-caret -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:907: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:907"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:907: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:907"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.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/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:907:  \$PREPARSER ./dancer"
at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:907"
( $at_check_trace;  $PREPARSER ./dancer
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:907: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:907"
( $at_check_trace; sed >&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"; $as_echo "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/regression.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:908' \
  "Dancer lalr1.cc" "                                " 18
at_xfail=no
(
  $as_echo "403. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >dancer.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code provides
{

  static int yylex (yy::parser::semantic_type *lvalp);
}
%skeleton "lalr1.cc"
%token ARROW INVALID NUMBER STRING DATA
%verbose
%error-verbose
/* Grammar follows */
%%
line: header body
   ;

header: '<' from ARROW to '>' type ':'
   | '<' ARROW to '>' type ':'
   | ARROW to type ':'
   | type ':'
   | '<' '>'
   ;

from: DATA
   | STRING
   | INVALID
   ;

to: DATA
   | STRING
   | INVALID
   ;

type: DATA
   | STRING
   | INVALID
   ;

body: %empty
   | body member
   ;

member: STRING
   | DATA
   | '+' NUMBER
   | '-' NUMBER
   | NUMBER
   | INVALID
   ;
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = ":";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/regression.at:908: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.cc dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:908"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.cc dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:908: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y" "regression.at:908"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:908: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:908"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:908: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:908"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:908: bison -fno-caret -o dancer.cc dancer.y"
at_fn_check_prepare_trace "regression.at:908"
( $at_check_trace; bison -fno-caret -o dancer.cc dancer.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:908: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:908"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:908: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS" "regression.at:908"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.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/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:908:  \$PREPARSER ./dancer"
at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:908"
( $at_check_trace;  $PREPARSER ./dancer
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:908: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:908"
( $at_check_trace; sed >&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"; $as_echo "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/regression.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:983' \
  "Expecting two tokens " "                          " 18
at_xfail=no
(
  $as_echo "404. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >expect2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (void);

#include <stdio.h>

static void yyerror (const char *msg);
%}

%error-verbose
%token A 1000
%token B

%%
program: %empty
 | program e ';'
 | program error ';';

e: e '+' t | t;
t: A | B;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}


#include <assert.h>
static int
yylex (void)
{
  static int const tokens[] =
    {
      1000, '+', '+', -1
    };
  static size_t toknum;

  assert (toknum < sizeof tokens / sizeof *tokens);
  return tokens[toknum++];
}
#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
$as_echo "$at_srcdir/regression.at:983: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:983"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:983: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:983"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:983: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:983"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:983: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:983"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:983: bison -fno-caret -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:983"
( $at_check_trace; bison -fno-caret -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:983: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:983"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:983: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:983"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.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/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:983:  \$PREPARSER ./expect2"
at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:983"
( $at_check_trace;  $PREPARSER ./expect2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:983: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:983"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '+', 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/regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:984' \
  "Expecting two tokens %glr-parser" "               " 18
at_xfail=no
(
  $as_echo "405. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >expect2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (void);

#include <stdio.h>

static void yyerror (const char *msg);
%}
%glr-parser
%error-verbose
%token A 1000
%token B

%%
program: %empty
 | program e ';'
 | program error ';';

e: e '+' t | t;
t: A | B;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}


#include <assert.h>
static int
yylex (void)
{
  static int const tokens[] =
    {
      1000, '+', '+', -1
    };
  static size_t toknum;

  assert (toknum < sizeof tokens / sizeof *tokens);
  return tokens[toknum++];
}
#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
$as_echo "$at_srcdir/regression.at:984: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:984"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:984: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:984"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:984: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:984"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:984: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:984"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:984: bison -fno-caret -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:984"
( $at_check_trace; bison -fno-caret -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:984: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:984"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:984: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:984"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.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/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:984:  \$PREPARSER ./expect2"
at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:984"
( $at_check_trace;  $PREPARSER ./expect2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:984: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:984"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '+', 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/regression.at:984"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:985' \
  "Expecting two tokens lalr1.cc" "                  " 18
at_xfail=no
(
  $as_echo "406. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >expect2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (int *);
#include <cstdlib>
%}
%skeleton "lalr1.cc"
%error-verbose
%token A 1000
%token B

%%
program: %empty
 | program e ';'
 | program error ';';

e: e '+' t | t;
t: A | B;

%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
int
yyparse ()
{
  yy::parser parser;
  return parser.parse ();
}


#include <assert.h>
static int
yylex (int *lval)
{
  static int const tokens[] =
    {
      1000, '+', '+', -1
    };
  static size_t toknum;
  *lval = 0; /* Pacify GCC.  */
  assert (toknum < sizeof tokens / sizeof *tokens);
  return tokens[toknum++];
}
#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
$as_echo "$at_srcdir/regression.at:985: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.cc expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:985"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.cc expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:985: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y" "regression.at:985"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:985: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:985"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:985: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:985"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:985: bison -fno-caret -o expect2.cc expect2.y"
at_fn_check_prepare_trace "regression.at:985"
( $at_check_trace; bison -fno-caret -o expect2.cc expect2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:985: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:985"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:985: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS" "regression.at:985"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.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/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:985:  \$PREPARSER ./expect2"
at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:985"
( $at_check_trace;  $PREPARSER ./expect2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:985: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:985"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected '+', 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/regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:993' \
  "Braced code in declaration in rules section" "    " 18
at_xfail=no
(
  $as_echo "407. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Bison once mistook braced code in a declaration in the rules section to be a
# rule action.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
%}
%debug
%error-verbose
%%

start:
  {
    printf ("Bison would once convert this action to a midrule because of the"
            " subsequent braced code.\n");
  }
  ;

%destructor { fprintf (stderr, "DESTRUCTOR\n"); } 'a';
%printer { fprintf (yyoutput, "PRINTER"); } 'a';

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1024: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1024"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1024"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1024: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1024"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1024"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1024: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1024"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1024"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1024: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1024"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1024"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1024: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1024"
( $at_check_trace; bison -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/regression.at:1024"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:1025: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1025"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1025: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1025"
( $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/regression.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1026:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1026"
( $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"; $as_echo "Bison would once convert this action to a midrule because of the subsequent braced code.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1026"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1026: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1026"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 20):
-> \$\$ = nterm start ()
Stack now 0
Entering state 1
Reading a token: Next token is token 'a' (PRINTER)
syntax error, unexpected 'a', expecting \$end
Error: popping nterm start ()
Stack now 0
Cleanup: discarding lookahead token 'a' (PRINTER)
DESTRUCTOR
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/regression.at:1026"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:1052' \
  "String alias declared after use" "                " 18
at_xfail=no
(
  $as_echo "408. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Bison once incorrectly asserted that the symbol number for either a token or
# its alias was the highest symbol number so far at the point of the alias
# declaration.  That was true unless the declaration appeared after their first
# uses and other tokens appeared in between.

cat >input.y <<'_ATEOF'
%%
start: 'a' "A" 'b';
%token '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
$as_echo "$at_srcdir/regression.at:1065: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1065"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1065"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1065: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1065"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1065"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1065: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1065"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1065"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1065: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1065"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1065"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1065: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1065"
( $at_check_trace; bison -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/regression.at:1065"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:1075' \
  "Extra lookahead sets in report" "                 " 18
at_xfail=no
(
  $as_echo "409. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Bison prints each reduction's lookahead set only next to the associated
# state's one item that (1) is associated with the same rule as the reduction
# and (2) has its dot at the end of its RHS.  Previously, Bison also
# erroneously printed the lookahead set next to all of the state's other items
# associated with the same rule.  This bug affected only the '.output' file and
# not the generated parser source code.

cat >input.y <<'_ATEOF'
%%
start: a | 'a' a 'a' ;
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
$as_echo "$at_srcdir/regression.at:1090: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1090"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --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/regression.at:1090"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1090: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml --report=all input.y" "regression.at:1090"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1090"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1090: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1090"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1090"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1090: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1090"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1090"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1090: bison -fno-caret --report=all input.y"
at_fn_check_prepare_trace "regression.at:1090"
( $at_check_trace; bison -fno-caret --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/regression.at:1090"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:1091: sed -n '/^State 1\$/,/^State 2\$/p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 1$/,/^State 2$/p' input.output" "regression.at:1091"
( $at_check_trace; sed -n '/^State 1$/,/^State 2$/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"; $as_echo "State 1

    2 start: 'a' . a 'a'
    3 a: . 'a'
    3  | 'a' .  [\$end]

    'a'  shift, and go to state 4

    \$default  reduce using rule 3 (a)

    a  go to state 5


State 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1091"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'regression.at:1116' \
  "Token number in precedence declaration" "         " 18
at_xfail=no
(
  $as_echo "410. $at_setup_line: testing $at_desc ..."
  $at_traceon


# POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
# we lost this in Bison 1.50.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%error-verbose
%right END 0
%left TK1 1 TK2 2 "tok alias" 3

%%

start:
    TK1 sr_conflict "tok alias"
  | start %prec END
  ;
sr_conflict:
  TK2
  | TK2 "tok alias"
  ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static int const input[] = { 1, 2, 3, 0 };
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/regression.at:1149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Wall -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1149"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" "regression.at:1149"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1149: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1149"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1149: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1149"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1149: bison -fno-caret -Wall -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1149"
( $at_check_trace; bison -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"; $as_echo "input.y:24.5-19: warning: rule useless in parser due to conflicts [-Wother]
input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1149"
$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
$as_echo "$at_srcdir/regression.at:1149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Werror" "regression.at:1149"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y:24.5-19: warning: rule useless in parser due to conflicts [-Wother]
input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1149: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1149"
( $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/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=error" "regression.at:1149"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror" "regression.at:1149"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1149: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror" "regression.at:1149"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Wall -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1149"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1154: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1154"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1154: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1154"
( $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/regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1155:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1155"
( $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/regression.at:1155"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1155: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1155"
( $at_check_trace; 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/regression.at:1155"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'regression.at:1169' \
  "parse-gram.y: LALR = IELR" "                      " 18
at_xfail=no
(
  $as_echo "411. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Avoid tests/bison's dark magic by processing a local copy of the
# grammar.  Avoid differences in synclines by telling bison that the
# output files have the same name.
cp $abs_top_srcdir/src/parse-gram.y input.y
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1175: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1175"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c -Dlr.type=lalr input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1175: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" "regression.at:1175"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1175: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1175"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1175: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1175"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1175: bison -fno-caret -o input.c -Dlr.type=lalr input.y"
at_fn_check_prepare_trace "regression.at:1175"
( $at_check_trace; bison -fno-caret -o input.c -Dlr.type=lalr 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/regression.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }


mv input.c lalr.c

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c -Dlr.type=ielr input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1178"
$at_failed && at_fn_log_failure  \
"lalr.c"
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1178: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" "regression.at:1178"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1178"
$at_failed && at_fn_log_failure  \
"lalr.c"
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1178: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1178"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1178"
$at_failed && at_fn_log_failure  \
"lalr.c"
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1178: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1178"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1178"
$at_failed && at_fn_log_failure  \
"lalr.c"
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1178: bison -fno-caret -o input.c -Dlr.type=ielr input.y"
at_fn_check_prepare_trace "regression.at:1178"
( $at_check_trace; bison -fno-caret -o input.c -Dlr.type=ielr 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/regression.at:1178"
$at_failed && at_fn_log_failure  \
"lalr.c"
$at_traceon; }


mv input.c ielr.c

{ set +x
$as_echo "$at_srcdir/regression.at:1181: diff lalr.c ielr.c"
at_fn_check_prepare_trace "regression.at:1181"
( $at_check_trace; diff lalr.c ielr.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/regression.at:1181"
$at_failed && at_fn_log_failure  \
"lalr.c" \
"ielr.c"
$at_traceon; }


  set +x
  $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 'regression.at:1191' \
  "parse.error=verbose and YYSTACK_USE_ALLOCA" "     " 18
at_xfail=no
(
  $as_echo "412. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  #define YYSTACK_USE_ALLOCA 1
}

%define parse.error verbose

%%

start: check syntax_error syntax_error ;

check:
{
  if (128 < sizeof yymsgbuf)
    {
      fprintf (stderr,
               "The initial size of yymsgbuf in yyparse has increased\n"
               "since this test group was last updated.  As a result,\n"
               "this test group may no longer manage to induce a\n"
               "reallocation of the syntax error message buffer.\n"
               "This test group must be adjusted to produce a longer\n"
               "error message.\n");
      YYABORT;
    }
}
;

// Induce a syntax error message whose total length is more than
// sizeof yymsgbuf in yyparse.  Each token here is 64 bytes.
syntax_error:
  "123456789112345678921234567893123456789412345678951234567896123A"
| "123456789112345678921234567893123456789412345678951234567896123B"
| error 'a' 'b' 'c'
;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
  /* Induce two syntax error messages (which requires full error
     recovery by shifting 3 tokens) in order to detect any loss of the
     reallocated buffer.  */
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "abc";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/regression.at:1242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1242"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1242"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1242: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1242"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1242"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1242: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1242"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1242"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1242: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1242"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1242"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1242: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1242"
( $at_check_trace; bison -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/regression.at:1242"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:1243: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1243"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1243"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1243: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1243"
( $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/regression.at:1243"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1244:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1244"
( $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/regression.at:1244"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1244: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1244"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
syntax error, unexpected \$end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1244"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:1265' \
  "parse.error=verbose overflow" "                   " 18
at_xfail=no
(
  $as_echo "413. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);

  /* This prevents this test case from having to induce error messages
     large enough to overflow size_t.  */
  #define YYSIZE_T unsigned char

  /* Bring in malloc and set EXIT_SUCCESS so yacc.c doesn't try to
     provide a malloc prototype using our YYSIZE_T.  */
  #include <stdlib.h>
  #ifndef EXIT_SUCCESS
  # define EXIT_SUCCESS 0
  #endif

  /* Max depth is usually much smaller than YYSTACK_ALLOC_MAXIMUM, and
     we don't want gcc to warn everywhere this constant would be too big
     to make sense for our YYSIZE_T.  */
  #define YYMAXDEPTH 100
}

%define parse.error verbose

%%

start: syntax_error1 check syntax_error2 ;

// Induce a syntax error message whose total length causes yymsg in
// yyparse to be reallocated to size YYSTACK_ALLOC_MAXIMUM, which
// should be 255.  Each token here is 64 bytes.
syntax_error1:
  "123456789112345678921234567893123456789412345678951234567896123A"
| "123456789112345678921234567893123456789412345678951234567896123B"
| "123456789112345678921234567893123456789412345678951234567896123C"
| error 'a' 'b' 'c'
;

check:
{
  if (yymsg_alloc != YYSTACK_ALLOC_MAXIMUM
      || YYSTACK_ALLOC_MAXIMUM != YYSIZE_MAXIMUM
      || YYSIZE_MAXIMUM != 255)
    {
      fprintf (stderr,
               "The assumptions of this test group are no longer\n"
               "valid, so it may no longer catch the error it was\n"
               "designed to catch.  Specifically, the following\n"
               "values should all be 255:\n\n");
      fprintf (stderr, "  yymsg_alloc = %d\n", yymsg_alloc);
      fprintf (stderr, "  YYSTACK_ALLOC_MAXIMUM = %d\n",
               YYSTACK_ALLOC_MAXIMUM);
      fprintf (stderr, "  YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM);
      YYABORT;
    }
}
;

// Now overflow.
syntax_error2:
  "123456789112345678921234567893123456789412345678951234567896123A"
| "123456789112345678921234567893123456789412345678951234567896123B"
| "123456789112345678921234567893123456789412345678951234567896123C"
| "123456789112345678921234567893123456789412345678951234567896123D"
| "123456789112345678921234567893123456789412345678951234567896123E"
;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
  /* Induce two syntax error messages (which requires full error
     recovery by shifting 3 tokens).  */
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "abc";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
int
main (void)
{
  /* Push parsers throw away the message buffer between tokens, so skip
     this test under maintainer-push-check.  */
  if (YYPUSH)
    return 77;
  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
$as_echo "$at_srcdir/regression.at:1352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1352"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1352"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1352: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1352"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1352"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1352: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1352"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1352"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1352: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1352"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1352"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1352: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1352"
( $at_check_trace; bison -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/regression.at:1352"
$at_failed && at_fn_log_failure
$at_traceon; }



# gcc warns about tautologies and fallacies involving comparisons for
# unsigned char.  However, it doesn't produce these same warnings for
# size_t and many other types when the warnings would seem to make just
# as much sense.  We ignore the warnings.
CFLAGS="$NO_WERROR_CFLAGS"
{ set +x
$as_echo "$at_srcdir/regression.at:1359: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1359"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1359"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1359: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1359"
( $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/regression.at:1359"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:1361:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1361"
( $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 2 $at_status "$at_srcdir/regression.at:1361"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1361: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1361"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B or 123456789112345678921234567893123456789412345678951234567896123C
syntax error
memory exhausted
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1361"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'regression.at:1375' \
  "LAC: Exploratory stack" "                         " 18
at_xfail=no
(
  $as_echo "414. $at_setup_line: testing $at_desc ..."
  $at_traceon








cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (void);
}
%debug
%define api.push-pull pull
%define parse.error verbose
%token 'c'

%%

// default reductions in inconsistent states
// v   v v   v v v v   v v v v v v v
S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ;
//       ^                     ^                               ^
// LAC reallocs

A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
B: 'b' ;
C: /*empty*/ { printf ("consistent default reduction\n"); } ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
int
yylex (void)
{
  static char const *input = "bbbbc";
  return *input++;
}

#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1448: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1448"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1448: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1448"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1448: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-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/regression.at:1448"
$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
$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1448: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1448"
( $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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1448: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1448: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1448"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1448: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1448"
( $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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1448:  \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1448"
( $at_check_trace;  $PREPARSER ./input --debug > stdout.txt 2> stderr.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 1 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1448: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1448"
( $at_check_trace; 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/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }



# Make sure syntax error doesn't forget that 'a' is expected.  It would
# be forgotten without lookahead correction.
{ set +x
$as_echo "$at_srcdir/regression.at:1448: grep 'syntax error,' stderr.txt"
at_fn_check_prepare_trace "regression.at:1448"
( $at_check_trace; grep 'syntax error,' stderr.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"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in inconsistent states to be sure
# syntax error is detected before unnecessary reductions are performed.
{ set +x
$as_echo "$at_srcdir/regression.at:1448: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "14" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in consistent states to be sure
# it is performed before the syntax error is detected.
{ set +x
$as_echo "$at_srcdir/regression.at:1448: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "2" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of reallocs to be sure reallocated memory isn't somehow
# lost between LAC invocations.
{ set +x
$as_echo "$at_srcdir/regression.at:1448: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
           || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1448"
( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
           || 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"; $as_echo "3" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1448"
$at_failed && at_fn_log_failure
$at_traceon; }








cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *);
}
%debug
%define api.push-pull pull %define api.pure
%define parse.error verbose
%token 'c'

%%

// default reductions in inconsistent states
// v   v v   v v v v   v v v v v v v
S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ;
//       ^                     ^                               ^
// LAC reallocs

A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
B: 'b' ;
C: /*empty*/ { printf ("consistent default reduction\n"); } ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
int
yylex (YYSTYPE *v)
{
  static char const *input = "bbbbc";
  *v = 0;
  return *input++;
}

#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1449: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1449"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1449: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1449"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1449: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-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/regression.at:1449"
$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
$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1449: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1449"
( $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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1449: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1449"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1449: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1449"
( $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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1449:  \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1449"
( $at_check_trace;  $PREPARSER ./input --debug > stdout.txt 2> stderr.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 1 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1449: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1449"
( $at_check_trace; 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/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }



# Make sure syntax error doesn't forget that 'a' is expected.  It would
# be forgotten without lookahead correction.
{ set +x
$as_echo "$at_srcdir/regression.at:1449: grep 'syntax error,' stderr.txt"
at_fn_check_prepare_trace "regression.at:1449"
( $at_check_trace; grep 'syntax error,' stderr.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"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in inconsistent states to be sure
# syntax error is detected before unnecessary reductions are performed.
{ set +x
$as_echo "$at_srcdir/regression.at:1449: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "14" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in consistent states to be sure
# it is performed before the syntax error is detected.
{ set +x
$as_echo "$at_srcdir/regression.at:1449: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "2" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of reallocs to be sure reallocated memory isn't somehow
# lost between LAC invocations.
{ set +x
$as_echo "$at_srcdir/regression.at:1449: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
           || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1449"
( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
           || 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"; $as_echo "3" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1449"
$at_failed && at_fn_log_failure
$at_traceon; }








cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (void);
}
%debug
%define api.push-pull both
%define parse.error verbose
%token 'c'

%%

// default reductions in inconsistent states
// v   v v   v v v v   v v v v v v v
S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ;
//       ^                     ^                               ^
// LAC reallocs

A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
B: 'b' ;
C: /*empty*/ { printf ("consistent default reduction\n"); } ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
int
yylex (void)
{
  static char const *input = "bbbbc";
  return *input++;
}

#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1450: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1450"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1450: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1450"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1450: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-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/regression.at:1450"
$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
$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1450: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1450"
( $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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1450: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1450: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1450"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1450: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1450"
( $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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1450:  \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1450"
( $at_check_trace;  $PREPARSER ./input --debug > stdout.txt 2> stderr.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 1 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1450: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1450"
( $at_check_trace; 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/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }



# Make sure syntax error doesn't forget that 'a' is expected.  It would
# be forgotten without lookahead correction.
{ set +x
$as_echo "$at_srcdir/regression.at:1450: grep 'syntax error,' stderr.txt"
at_fn_check_prepare_trace "regression.at:1450"
( $at_check_trace; grep 'syntax error,' stderr.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"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in inconsistent states to be sure
# syntax error is detected before unnecessary reductions are performed.
{ set +x
$as_echo "$at_srcdir/regression.at:1450: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "14" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in consistent states to be sure
# it is performed before the syntax error is detected.
{ set +x
$as_echo "$at_srcdir/regression.at:1450: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "2" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of reallocs to be sure reallocated memory isn't somehow
# lost between LAC invocations.
{ set +x
$as_echo "$at_srcdir/regression.at:1450: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
           || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1450"
( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
           || 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"; $as_echo "3" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1450"
$at_failed && at_fn_log_failure
$at_traceon; }








cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  int yylex (YYSTYPE *);
}
%debug
%define api.push-pull both %define api.pure
%define parse.error verbose
%token 'c'

%%

// default reductions in inconsistent states
// v   v v   v v v v   v v v v v v v
S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ;
//       ^                     ^                               ^
// LAC reallocs

A: 'a' | /*empty*/ { printf ("inconsistent default reduction\n"); } ;
B: 'b' ;
C: /*empty*/ { printf ("consistent default reduction\n"); } ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
int
yylex (YYSTYPE *v)
{
  static char const *input = "bbbbc";
  *v = 0;
  return *input++;
}

#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1451: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1451"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1451: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1451"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1451: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 21 shift/reduce conflicts [-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/regression.at:1451"
$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
$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: 21 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1451: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1451"
( $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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1451: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -Dparse.lac.memory-trace=full \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -Dparse.lac.memory-trace=full \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1451: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1451"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1451: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1451"
( $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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1451:  \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1451"
( $at_check_trace;  $PREPARSER ./input --debug > stdout.txt 2> stderr.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 1 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1451"
( $at_check_trace; 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/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }



# Make sure syntax error doesn't forget that 'a' is expected.  It would
# be forgotten without lookahead correction.
{ set +x
$as_echo "$at_srcdir/regression.at:1451: grep 'syntax error,' stderr.txt"
at_fn_check_prepare_trace "regression.at:1451"
( $at_check_trace; grep 'syntax error,' stderr.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"; $as_echo "syntax error, unexpected 'c', expecting 'a' or 'b'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in inconsistent states to be sure
# syntax error is detected before unnecessary reductions are performed.
{ set +x
$as_echo "$at_srcdir/regression.at:1451: \$PERL -0777 -ne 'print s/inconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; $PERL -0777 -ne 'print s/inconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "14" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of default reductions in consistent states to be sure
# it is performed before the syntax error is detected.
{ set +x
$as_echo "$at_srcdir/regression.at:1451: \$PERL -0777 -ne 'print s/\\bconsistent default reduction//g;' \\
           < stdout.txt || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; $PERL -0777 -ne 'print s/\bconsistent default reduction//g;' \
           < stdout.txt || 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"; $as_echo "2" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check number of reallocs to be sure reallocated memory isn't somehow
# lost between LAC invocations.
{ set +x
$as_echo "$at_srcdir/regression.at:1451: \$PERL -0777 -ne 'print s/\\(realloc//g;' < stderr.txt \\
           || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1451"
( $at_check_trace; $PERL -0777 -ne 'print s/\(realloc//g;' < stderr.txt \
           || 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"; $as_echo "3" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1451"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'regression.at:1463' \
  "LAC: Memory exhaustion" "                         " 18
at_xfail=no
(
  $as_echo "415. $at_setup_line: testing $at_desc ..."
  $at_traceon




# Check for memory exhaustion during parsing.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  #define YYMAXDEPTH 8
}
%debug
%error-verbose

%%

S: A A A A A A A A A ;
A: /*empty*/ | 'a' ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1496: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1496"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1496: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1496"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1496: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 8 shift/reduce conflicts [-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/regression.at:1496"
$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
$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: 8 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1496: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1496"
( $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/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1496: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1496"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1496: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1496"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1496: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1496"
( $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/regression.at:1496"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:1497:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1497"
( $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 2 $at_status "$at_srcdir/regression.at:1497"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1497: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1497"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reading a token: Now at end of input.
LAC: initial context established for \$end
LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
memory exhausted
Cleanup: discarding lookahead token \$end ()
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/regression.at:1497"
$at_failed && at_fn_log_failure
$at_traceon; }



# Induce an immediate syntax error with an undefined token, and check
# for memory exhaustion while building syntax error message.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  #define YYMAXDEPTH 8
}
%debug
%error-verbose

%%

S: A A A A A A A A A ;
A: /*empty*/ | 'a' ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "z";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1510: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1510"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1510: bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 8 shift/reduce conflicts [-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/regression.at:1510"
$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
$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
input.y: warning: 8 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/regression.at:1510: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1510"
( $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/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -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/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1510: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \\
                 -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1510"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 \
                 -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1510: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1510"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1510: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1510"
( $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/regression.at:1510"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:1511:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1511"
( $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 2 $at_status "$at_srcdir/regression.at:1511"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1511: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1511"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token \$undefined ()
LAC: initial context established for \$undefined
LAC: checking lookahead \$undefined: Always Err
Constructing syntax error message
LAC: checking lookahead \$end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
syntax error
memory exhausted
Cleanup: discarding lookahead token \$undefined ()
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/regression.at:1511"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'regression.at:1593' \
  "Lex and parse params: yacc.c" "                   " 18
at_xfail=no
(
  $as_echo "416. $at_setup_line: testing $at_desc ..."
  $at_traceon


## FIXME: Improve parsing of parse-param.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%skeleton "yacc.c"
%union { int ival; }
%parse-param { int x }
// Spaces, tabs, and new lines.
%parse-param { 
	 int y	 
         
 
}

%{
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (int x, int y, const char *msg);
  static int yylex (void);
%}

%%
exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
%%


# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (int x, int y, const char *msg)
{
  YYUSE(x);
  YYUSE(y);
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  (yylloc).first_line = (yylloc).last_line = 1;
  (yylloc).first_column = (yylloc).last_column = toknum;
  return res;
}



int
main (void)
{
  return yyparse(1, 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
$as_echo "$at_srcdir/regression.at:1593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1593"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1593"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1593: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1593"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1593: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1593"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1593: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1593"
( $at_check_trace; bison -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/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:1593: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1593"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1593: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1593"
( $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/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1593:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1593"
( $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"; $as_echo "x: 1, y: 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1593: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1593"
( $at_check_trace; 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/regression.at:1593"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'regression.at:1594' \
  "Lex and parse params: glr.c" "                    " 18
at_xfail=no
(
  $as_echo "417. $at_setup_line: testing $at_desc ..."
  $at_traceon


## FIXME: Improve parsing of parse-param.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%skeleton "glr.c"
%union { int ival; }
%parse-param { int x }
// Spaces, tabs, and new lines.
%parse-param { 
	 int y	 
         
 
}

%{
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (int x, int y, const char *msg);
  static int yylex (void);
%}

%%
exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
%%


# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (int x, int y, const char *msg)
{
  YYUSE(x);
  YYUSE(y);
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  (yylloc).first_line = (yylloc).last_line = 1;
  (yylloc).first_column = (yylloc).last_column = toknum;
  return res;
}



int
main (void)
{
  return yyparse(1, 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
$as_echo "$at_srcdir/regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1594: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1594"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1594: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1594"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1594: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1594"
( $at_check_trace; bison -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/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:1594: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1594"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1594: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1594"
( $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/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1594:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1594"
( $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"; $as_echo "x: 1, y: 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1594: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1594"
( $at_check_trace; 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/regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'regression.at:1595' \
  "Lex and parse params: lalr1.cc" "                 " 18
at_xfail=no
(
  $as_echo "418. $at_setup_line: testing $at_desc ..."
  $at_traceon


## FIXME: Improve parsing of parse-param.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%skeleton "lalr1.cc"
%union { int ival; }
%parse-param { int x }
// Spaces, tabs, and new lines.
%parse-param { 
	 int y	 
         
 
}

%{

  static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
%}

%%
exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  (void) lvalp;(void) llocp;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  (*llocp).begin.line = (*llocp).end.line = 1;
  (*llocp).begin.column = (*llocp).end.column = toknum;
  return res;
}

int
yyparse (int x, int y)
{
  yy::parser parser(x, y);
  return parser.parse ();
}


int
main (void)
{
  return yyparse(1, 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
$as_echo "$at_srcdir/regression.at:1595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1595"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1595: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1595"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1595: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1595"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1595: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1595"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1595: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "regression.at:1595"
( $at_check_trace; bison -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/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:1595: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1595"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1595: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1595"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1595:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1595"
( $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"; $as_echo "x: 1, y: 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1595: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1595"
( $at_check_trace; 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/regression.at:1595"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'regression.at:1596' \
  "Lex and parse params: glr.cc" "                   " 18
at_xfail=no
(
  $as_echo "419. $at_setup_line: testing $at_desc ..."
  $at_traceon


## FIXME: Improve parsing of parse-param.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%skeleton "glr.cc"
%union { int ival; }
%parse-param { int x }
// Spaces, tabs, and new lines.
%parse-param { 
	 int y	 
         
 
}

%{

  static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp);
%}

%%
exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); };
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  (void) lvalp;(void) llocp;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  (*llocp).begin.line = (*llocp).end.line = 1;
  (*llocp).begin.column = (*llocp).end.column = toknum;
  return res;
}

int
yyparse (int x, int y)
{
  yy::parser parser(x, y);
  return parser.parse ();
}


int
main (void)
{
  return yyparse(1, 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
$as_echo "$at_srcdir/regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1596"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1596: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1596"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1596: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1596"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1596: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1596"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1596: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "regression.at:1596"
( $at_check_trace; bison -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/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/regression.at:1596: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1596"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1596: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "regression.at:1596"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1596:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1596"
( $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"; $as_echo "x: 1, y: 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1596: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "regression.at:1596"
( $at_check_trace; 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/regression.at:1596"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'regression.at:1607' \
  "stdio.h is not needed" "                          " 18
at_xfail=no
(
  $as_echo "420. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations
%code
{
  static int yylex (void) { return 0; }
  static void yyerror (const char* msg) { (void) msg; }
}
%%
exp: {}
%%
#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
$as_echo "$at_srcdir/regression.at:1624: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1624"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1624: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1624"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1624: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1624"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/regression.at:1624: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1624"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1624: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1624"
( $at_check_trace; bison -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/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }


 { set +x
$as_echo "$at_srcdir/regression.at:1624: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "regression.at:1624"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1624: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1624"
( $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/regression.at:1624"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'push.at:24' \
  "Memory Leak for Early Deletion" "                 " 19
at_xfail=no
(
  $as_echo "421. $at_setup_line: testing $at_desc ..."
  $at_traceon


# Requires Valgrind.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <assert.h>
  #include <stdio.h>
  #define YYINITDEPTH 1
#include <stdio.h>

static void yyerror (const char *msg);
%}

%define api.pure
%define api.push-pull push

%%

start: 'a' 'b' 'c' ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yypstate *ps;

  /* Make sure we don't try to free ps->yyss in this case.  */
  ps = yypstate_new ();
  yypstate_delete (ps);

  /* yypstate_delete used to leak ps->yyss if the stack was reallocated but the
     parse did not return on success, syntax error, or memory exhaustion.  */
  ps = yypstate_new ();
  assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE);
  yypstate_delete (ps);

  ps = yypstate_new ();
  assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE);
  assert (yypush_parse (ps, 'b', YY_NULLPTR) == YYPUSH_MORE);
  yypstate_delete (ps);

  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
$as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:73"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/push.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:73: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:73"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/push.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/push.at:73: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:73"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/push.at:73: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "push.at:73"
( $at_check_trace; bison -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/push.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/push.at:74: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:74"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:74: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:74"
( $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/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:75:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:75"
( $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/push.at:75"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:75: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "push.at:75"
( $at_check_trace; 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/push.at:75"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'push.at:83' \
  "Multiple impure instances" "                      " 19
at_xfail=no
(
  $as_echo "422. $at_setup_line: testing $at_desc ..."
  $at_traceon






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <assert.h>
  #include <stdio.h>
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
%}

%define api.push-pull both

%%

start: ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}

int
main (void)
{
  int i;
  for (i = 0; i < 2; ++i)
    {
      yypstate *ps = yypstate_new ();
      assert (ps);
      assert (yypstate_new () == YY_NULLPTR);
      assert (yyparse () == 2);
      yychar = 0;
      assert (yypush_parse (ps) == 0);
      assert (yypstate_new () == YY_NULLPTR);
      assert (yyparse () == 2);
      yypstate_delete (ps);
    }

  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
$as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:133"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:133: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:133"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:133: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:133"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/push.at:133: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:133"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/push.at:133: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "push.at:133"
( $at_check_trace; bison -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/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/push.at:133: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:133"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:133: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:133"
( $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/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:133:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:133"
( $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/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:133: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "push.at:133"
( $at_check_trace; 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/push.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }






cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <assert.h>
  #include <stdio.h>
#include <stdio.h>

static void yyerror (const char *msg);

%}

%define api.push-pull push

%%

start: ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}


int
main (void)
{
  int i;
  for (i = 0; i < 2; ++i)
    {
      yypstate *ps = yypstate_new ();
      assert (ps);
      assert (yypstate_new () == YY_NULLPTR);
      ;
      yychar = 0;
      assert (yypush_parse (ps) == 0);
      assert (yypstate_new () == YY_NULLPTR);
      ;
      yypstate_delete (ps);
    }

  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
$as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:134"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:134: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:134"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:134"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/push.at:134: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "push.at:134"
( $at_check_trace; bison -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/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/push.at:134: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "push.at:134"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:134"
( $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/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:134:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:134"
( $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/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:134: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "push.at:134"
( $at_check_trace; 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/push.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }







  set +x
  $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 'push.at:144' \
  "Unsupported Skeletons" "                          " 19
at_xfail=no
(
  $as_echo "423. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%glr-parser
%define api.push-pull push
%%
start: ;
_ATEOF




{ set +x
$as_echo "$at_srcdir/push.at:155: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret input.y" "push.at:155"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-21: error: %define variable 'api.push-pull' 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/push.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_423
#AT_START_424
at_fn_group_banner 424 'c++.at:25' \
  "C++ Locations" "                                  " 20
at_xfail=no
(
  $as_echo "424. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {#include <sstream>}
%locations
%debug
%skeleton "lalr1.cc"
%code
{

static int yylex (yy::parser::semantic_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 << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  (void) lvalp;(void) llocp;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  (*llocp).begin.line = (*llocp).end.line = 1;
  (*llocp).begin.column = (*llocp).end.column = toknum;
  return res;
}

template <typename T>
bool
check (const T& in, const std::string& s)
{
  std::stringstream os;
  os << in;
  if (os.str () != s)
    {
      std::cerr << "fail: " << os.str () << ", expected: " << s << std::endl;
      return false;
    }
  return true;
}

int
main (void)
{
  int fail = 0;
  yy::parser::location_type loc;  fail += check (loc, "1.1");
                     fail += check (loc + 10, "1.1-10");
  loc += 10;         fail += check (loc, "1.1-10");
  loc += -5;         fail += check (loc, "1.1-5");
                     fail += check (loc - 5, "1.1");
  loc -= 5;          fail += check (loc, "1.1");
  // Check that we don't go below.
  // http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html
  loc -= 10;         fail += check (loc, "1.1");

  loc.columns (10); loc.lines (10); fail += check (loc, "1.1-11.0");
  loc.lines (-2);                   fail += check (loc, "1.1-9.0");
  loc.lines (-10);                  fail += check (loc, "1.1");

  yy::parser::location_type loc2 (YY_NULLPTR, 5, 10);
                   fail += check (loc2, "5.10");
                   fail += check (loc + loc2, "1.1-5.9");
  loc += loc2;     fail += check (loc, "1.1-5.9");
  return !fail;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:84: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:84"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:84: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:84"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:84: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:84"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:84: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:84"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:84: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:84"
( $at_check_trace; bison -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/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:84: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:84"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:84: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:84"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:85:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:85"
( $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/c++.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:85: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:85"
( $at_check_trace; 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/c++.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'c++.at:94' \
  "C++ Variant-based Symbols" "                      " 20
at_xfail=no
(
  $as_echo "425. $at_setup_line: testing $at_desc ..."
  $at_traceon





# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%define api.value.type variant
%define parse.assert
%debug

%code top
{
  // Get access to stack_symbol_type for the tests.
# define private public
}
%code provides
{
  static int yylex (yy::parser::semantic_type *lvalp);
}

%token <int> INT "int"
%type < std::list<int> > exp

%printer { yyo << $$; } <int>
%printer
  {
    for (std::list<int>::const_iterator i = $$.begin (); i != $$.end (); ++i)
      {
        if (i != $$.begin ())
          yyo << ", ";
        yyo << *i;
      }
  } < std::list<int> >

%code requires { #include <list> }
%code { int yylex (yy::parser::semantic_type* yylval); }

%%
exp: "int" { $$.push_back ($1); }
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <assert.h>
static
int yylex (yy::parser::semantic_type *lvalp)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  (void) lvalp;;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}

int main()
{
  {
    yy::parser::symbol_type s = yy::parser::make_INT(12);
    std::cerr << s.value.as<int>() << std::endl;
  }

  {
    yy::parser::symbol_type s = yy::parser::make_INT(123);
    yy::parser::stack_symbol_type ss(1, s);
    std::cerr << ss.value.as<int>() << std::endl;
  }

  {
    yy::parser::stack_type st;
    for (int i = 0; i < 100; ++i)
      {
        yy::parser::symbol_type s(yy::parser::make_INT(i));
        yy::parser::stack_symbol_type ss(1, s);
        st.push(ss);
      }
  }
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:164: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:164"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:164: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:164"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:164: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:164"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:164: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:164"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:164: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:164"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:164: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:164"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:164: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:164"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:165:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:165"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:165: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:165"
( $at_check_trace; sed >&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"; $as_echo "12
123
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:165"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'c++.at:370' \
  "Variants lalr1.cc " "                             " 20
at_xfail=no
(
  $as_echo "426. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc"

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::token_type yylex (parser::semantic_type* yylval);
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%
#ifdef TWO_STAGE_BUILD
# define BUILD(Type, Value) build<Type> () = Value
#else
# define BUILD(Type, Value) build (Value)
#endif

#define STAGE_MAX 5
namespace yy
{
  static
  parser::token_type yylex (parser::semantic_type* yylval)
  {
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        return parser::token::END_OF_FILE;

      case ',':


        return parser::token::COMMA;

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           yylval->BUILD (int, stage);
           return parser::token::NUMBER;
         }
       else
         {
           yylval->BUILD (std::string, to_string (stage));
           return parser::token::TEXT;
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:370: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:370"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:370: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:370"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:370: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:370"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:370: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:370"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:370: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:370"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:370: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:370"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:370: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:370"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:370:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:370"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.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_426
#AT_START_427
at_fn_group_banner 427 'c++.at:371' \
  "Variants lalr1.cc parse.assert" "                 " 20
at_xfail=no
(
  $as_echo "427. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc" %define parse.assert

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::token_type yylex (parser::semantic_type* yylval);
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%
#ifdef TWO_STAGE_BUILD
# define BUILD(Type, Value) build<Type> () = Value
#else
# define BUILD(Type, Value) build (Value)
#endif

#define STAGE_MAX 5
namespace yy
{
  static
  parser::token_type yylex (parser::semantic_type* yylval)
  {
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        return parser::token::END_OF_FILE;

      case ',':


        return parser::token::COMMA;

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           yylval->BUILD (int, stage);
           return parser::token::NUMBER;
         }
       else
         {
           yylval->BUILD (std::string, to_string (stage));
           return parser::token::TEXT;
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:371: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:371"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:371: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:371"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:371: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:371"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:371: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:371"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:371: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:371"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:371: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:371"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:371: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:371"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:371:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:371"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.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_427
#AT_START_428
at_fn_group_banner 428 'c++.at:372' \
  "Variants lalr1.cc parse.assert %locations" "      " 20
at_xfail=no
(
  $as_echo "428. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc" %define parse.assert %locations

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::token_type yylex (parser::semantic_type* yylval,
                              parser::location_type* yylloc);
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%
#ifdef TWO_STAGE_BUILD
# define BUILD(Type, Value) build<Type> () = Value
#else
# define BUILD(Type, Value) build (Value)
#endif

#define STAGE_MAX 5
namespace yy
{
  static
  parser::token_type yylex (parser::semantic_type* yylval,
                            parser::location_type* yylloc)
  {
    typedef parser::location_type location;
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        *yylloc = location ();
        return parser::token::END_OF_FILE;

      case ',':


        *yylloc = location ();
        return parser::token::COMMA;

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           yylval->BUILD (int, stage);
           *yylloc = location ();
           return parser::token::NUMBER;
         }
       else
         {
           yylval->BUILD (std::string, to_string (stage));
           *yylloc = location ();
           return parser::token::TEXT;
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:372"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:372: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:372"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:372: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:372"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:372: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:372"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:372: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:372"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:372: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:372"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:372: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:372"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:372:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:372"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.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_428
#AT_START_429
at_fn_group_banner 429 'c++.at:373' \
  "Variants lalr1.cc parse.assert %code {\\n#define TWO_STAGE_BUILD\\n}" "" 20
at_xfail=no
(
  $as_echo "429. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc" %define parse.assert %code {
#define TWO_STAGE_BUILD
}

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::token_type yylex (parser::semantic_type* yylval);
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%
#ifdef TWO_STAGE_BUILD
# define BUILD(Type, Value) build<Type> () = Value
#else
# define BUILD(Type, Value) build (Value)
#endif

#define STAGE_MAX 5
namespace yy
{
  static
  parser::token_type yylex (parser::semantic_type* yylval)
  {
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        return parser::token::END_OF_FILE;

      case ',':


        return parser::token::COMMA;

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           yylval->BUILD (int, stage);
           return parser::token::NUMBER;
         }
       else
         {
           yylval->BUILD (std::string, to_string (stage));
           return parser::token::TEXT;
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:373: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:373"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:373: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:373"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:373: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:373"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:373: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:373"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:373: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:373"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:373: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:373"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:373: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:373"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:373:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:373"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:373: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.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_429
#AT_START_430
at_fn_group_banner 430 'c++.at:374' \
  "Variants lalr1.cc parse.assert api.token.constructor" "" 20
at_xfail=no
(
  $as_echo "430. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::symbol_type yylex ();
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%

#define STAGE_MAX 5
namespace yy
{
  static
  parser::symbol_type yylex ()
  {
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        return parser::make_END_OF_FILE ();

      case ',':

        return parser::make_COMMA ();

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           return parser::make_NUMBER (stage);
         }
       else
         {
           return parser::make_TEXT (to_string (stage));
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:374: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:374"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:374: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:374"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:374: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:374"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:374: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:374"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:374: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:374"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:374: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:374"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:374:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:374"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.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_430
#AT_START_431
at_fn_group_banner 431 'c++.at:375' \
  "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_}" "" 20
at_xfail=no
(
  $as_echo "431. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_}

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::symbol_type yylex ();
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%

#define STAGE_MAX 5
namespace yy
{
  static
  parser::symbol_type yylex ()
  {
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        return parser::make_END_OF_FILE ();

      case ',':

        return parser::make_COMMA ();

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           return parser::make_NUMBER (stage);
         }
       else
         {
           return parser::make_TEXT (to_string (stage));
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:375"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:375: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:375"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:375: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:375"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:375: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:375"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:375: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:375"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:375: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:375"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:375: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:375"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:375:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:375"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:375"
( $at_check_trace; sed >&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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:375"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'c++.at:376' \
  "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations" "" 20
at_xfail=no
(
  $as_echo "432. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Store strings and integers in a list of strings.
cat >list.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug
%define api.value.type variant
%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_} %locations

%code requires // code for the .hh file
{
#include <list>
#include <string>
typedef std::list<std::string> strings_type;
}

%code // code for the .cc file
{
#include <cstdlib> // abort, getenv
#include <iostream>
#include <sstream>

  namespace yy
  {
    static
    parser::symbol_type yylex ();
  }

  // Printing a list of strings (for %printer).
  // Koening look up will look into std, since that's an std::list.
  namespace std
  {
    std::ostream&
    operator<<(std::ostream& o, const strings_type& s)
    {
      o << '(';
      for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i)
        {
          if (i != s.begin ())
            o << ", ";
          o << *i;
        }
      return o << ')';
    }
  }

  // Conversion to string.
  template <typename T>
    inline
    std::string
    to_string (const T& t)
  {
    std::ostringstream o;
    o << t;
    return o.str ();
  }
}

%token <::std::string> TEXT;
%token <int> NUMBER;
%token END_OF_FILE 0;
%token COMMA ","

%type <::std::string> item;
// Using the template type to exercize its parsing.
// Starting with :: to ensure we don't output "<::" which starts by the
// digraph for the left square bracket.
%type <::std::list<std::string>> list;

%printer { yyo << $$; }
  <int> <::std::string> <::std::list<std::string>>;
%destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
%destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
%%

result:
  list          { std::cout << $1 << std::endl; }
;

list:
  item          { $$.push_back ($1); }
| list "," item { std::swap ($$, $1); $$.push_back ($3); }
| list error    { std::swap ($$, $1); }
;

item:
  TEXT          { std::swap ($$, $1); }
| NUMBER        { if ($1 == 3) YYERROR; else $$ = to_string ($1); }
;
%%

#define STAGE_MAX 5
namespace yy
{
  static
  parser::symbol_type yylex ()
  {
    typedef parser::location_type location;
    // The 5 is a syntax error whose recovery requires that we discard
    // the lookahead.  This tests a regression, see
    // <http://savannah.gnu.org/support/?108481>.
    static char const *input = "0,1,2,3,45,6";
    switch (int stage = *input++)
    {
      case 0:
        return parser::make_END_OF_FILE (location ());

      case ',':

        return parser::make_COMMA (location ());

      default:
        stage = stage - '0';
        if (stage % 2)
         {
           return parser::make_NUMBER (stage, location ());
         }
       else
         {
           return parser::make_TEXT (to_string (stage), location ());
         }
    }

    abort ();
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const location_type& l, const std::string& m)
{
  std::cerr << l << ": " << m << std::endl;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  yy::parser p;
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    p.set_debug_level (true);
  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
$as_echo "$at_srcdir/c++.at:376: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o list.cc list.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:376"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:376: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:376"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:376: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:376"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:376: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:376"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:376: bison -fno-caret -o list.cc list.y"
at_fn_check_prepare_trace "c++.at:376"
( $at_check_trace; bison -fno-caret -o list.cc list.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:376: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:376"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:376: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:376"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.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/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:376:  \$PREPARSER ./list"
at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:376"
( $at_check_trace;  $PREPARSER ./list
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:376: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:376"
( $at_check_trace; sed >&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"; $as_echo "Destroy: \"\"
Destroy: \"0\"
Destroy: 1
Destroy: \"1\"
Destroy: ()
Destroy: \"\"
Destroy: \"2\"
Destroy: ()
Destroy: \"\"
Destroy: 3
Destroy: ()
Destroy: \"\"
Destroy: \"4\"
Destroy: ()
Destroy: ()
Destroy: 5
Destroy: ()
Destroy: \"\"
Destroy: \"6\"
Destroy: ()
Destroy: (0, 1, 2, 4, 6)
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:376"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'c++.at:460' \
  "Doxygen Public Documentation" "                   " 20
at_xfail=no
(
  $as_echo "433. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.yy <<'_ATEOF'
%skeleton "lalr1.cc"
%locations
%defines
%debug
%%
exp: /* empty */;
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:460: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:460"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >Doxyfile <<'_ATEOF'
# The PROJECT_NAME tag is a single word (or a sequence of words
# surrounded by quotes) that should identify the project.
PROJECT_NAME = "Bison C++ Parser"

# The QUIET tag can be used to turn on/off the messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
QUIET = YES

# The WARNINGS tag can be used to turn on/off the warning messages
# that are generated by doxygen. Possible values are YES and NO. If
# left blank NO is used.
WARNINGS     = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then
# this flag will automatically be disabled.
WARN_IF_UNDOCUMENTED   = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings
# for potential errors in the documentation, such as not documenting
# some parameters in a documented function, or documenting parameters
# that don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR      = YES
# The WARN_FORMAT tag determines the format of the warning messages
# that doxygen can produce. The string should contain the $file,
# $line, and $text tags, which will be replaced by the file and line
# number from which the warning originated and the warning text.
WARN_FORMAT            = "$file:$line: $text"

# If the EXTRACT_ALL tag is set to YES doxygen will assume all
# entities in documentation are documented, even if no documentation
# was available.  Private class members and static file members will
# be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set
# to YES
EXTRACT_ALL            = YES

# If the EXTRACT_PRIVATE tag is set to YES all private members of a
# class will be included in the documentation.
EXTRACT_PRIVATE        = NO

# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC         = NO
_ATEOF


{ set +x
$as_echo "$at_srcdir/c++.at:460: doxygen --version || exit 77"
at_fn_check_prepare_trace "c++.at:460"
( $at_check_trace; doxygen --version || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:460: doxygen"
at_fn_check_prepare_trace "c++.at:460"
( $at_check_trace; doxygen
) >>"$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/c++.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'c++.at:461' \
  "Doxygen Private Documentation" "                  " 20
at_xfail=no
(
  $as_echo "434. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.yy <<'_ATEOF'
%skeleton "lalr1.cc"
%locations
%defines
%debug
%%
exp: /* empty */;
%%
/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  std::cerr << m << std::endl;
}
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:461: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:461"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:461: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:461"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:461: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:461"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >Doxyfile <<'_ATEOF'
# The PROJECT_NAME tag is a single word (or a sequence of words
# surrounded by quotes) that should identify the project.
PROJECT_NAME = "Bison C++ Parser"

# The QUIET tag can be used to turn on/off the messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
QUIET = YES

# The WARNINGS tag can be used to turn on/off the warning messages
# that are generated by doxygen. Possible values are YES and NO. If
# left blank NO is used.
WARNINGS     = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then
# this flag will automatically be disabled.
WARN_IF_UNDOCUMENTED   = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings
# for potential errors in the documentation, such as not documenting
# some parameters in a documented function, or documenting parameters
# that don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR      = YES
# The WARN_FORMAT tag determines the format of the warning messages
# that doxygen can produce. The string should contain the $file,
# $line, and $text tags, which will be replaced by the file and line
# number from which the warning originated and the warning text.
WARN_FORMAT            = "$file:$line: $text"

# If the EXTRACT_ALL tag is set to YES doxygen will assume all
# entities in documentation are documented, even if no documentation
# was available.  Private class members and static file members will
# be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set
# to YES
EXTRACT_ALL            = YES

# If the EXTRACT_PRIVATE tag is set to YES all private members of a
# class will be included in the documentation.
EXTRACT_PRIVATE        = YES

# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC         = YES
_ATEOF


{ set +x
$as_echo "$at_srcdir/c++.at:461: doxygen --version || exit 77"
at_fn_check_prepare_trace "c++.at:461"
( $at_check_trace; doxygen --version || 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 stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:461: doxygen"
at_fn_check_prepare_trace "c++.at:461"
( $at_check_trace; doxygen
) >>"$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/c++.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'c++.at:515' \
  "Relative namespace references" "                  " 20
at_xfail=no
(
  $as_echo "435. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::parser::error (const foo::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo::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
$as_echo "$at_srcdir/c++.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:516"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:516"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:516: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:516"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:516: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:516"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:516: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:516"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:516: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:516"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:516: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:516"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:516:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:516"
( $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/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:516"
( $at_check_trace; 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/c++.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo::bar}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo::bar::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar::parser::error (const foo::bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo::bar::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
$as_echo "$at_srcdir/c++.at:517: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:517"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:517: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:517"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:517: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:517"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:517: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:517"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:517: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:517"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:517: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:517"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:517: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:517"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:517:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:517"
( $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/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:517: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:517"
( $at_check_trace; 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/c++.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo::bar::baz}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo::bar::baz::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar::baz::parser::error (const foo::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo::bar::baz::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
$as_echo "$at_srcdir/c++.at:518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:518: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:518"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:518: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:518"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:518: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:518"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:518:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.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 0 $at_status "$at_srcdir/c++.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.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
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.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_435
#AT_START_436
at_fn_group_banner 436 'c++.at:521' \
  "Absolute namespace references" "                  " 20
at_xfail=no
(
  $as_echo "436. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {::foo}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const ::foo::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
::foo::parser::error (const ::foo::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  ::foo::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
$as_echo "$at_srcdir/c++.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:522: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:522"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:522: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:522"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:522: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:522"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:522: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:522"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:522:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:522"
( $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/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:522: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:522"
( $at_check_trace; 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/c++.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {::foo::bar}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const ::foo::bar::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  ::foo::bar::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
$as_echo "$at_srcdir/c++.at:523: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:523"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:523: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:523"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:523: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:523"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:523: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:523"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:523: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:523"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:523: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:523"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:523: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:523"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:523:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:523"
( $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/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:523: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:523"
( $at_check_trace; 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/c++.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {::foo::bar::baz}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const ::foo::bar::baz::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  ::foo::bar::baz::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
$as_echo "$at_srcdir/c++.at:524: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:524"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:524: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:524"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:524: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:524"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:524: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:524"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:524: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:524"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:524: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:524"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:524: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:524"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:524:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:524"
( $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/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:524: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:524"
( $at_check_trace; 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/c++.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {	::foo}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const 	::foo::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
	::foo::parser::error (const 	::foo::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  	::foo::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
$as_echo "$at_srcdir/c++.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:525"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:525: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:525"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:525: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:525"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:525: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:525"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:525: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:525"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:525: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:525"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:525: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:525"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:525:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:525"
( $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/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:525: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:525"
( $at_check_trace; 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/c++.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {  	 ::foo::bar}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const   	 ::foo::bar::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
  	 ::foo::bar::parser::error (const   	 ::foo::bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
    	 ::foo::bar::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
$as_echo "$at_srcdir/c++.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:526"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:526"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:526: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:526"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:526: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:526"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:526: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:526"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:526: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:526"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:526: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:526"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:526:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:526"
( $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/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:526: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:526"
( $at_check_trace; 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/c++.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {  ::foo::bar::baz}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const   ::foo::bar::baz::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
  ::foo::bar::baz::parser::error (const   ::foo::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
    ::foo::bar::baz::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
$as_echo "$at_srcdir/c++.at:527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:527: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:527"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:527: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:527"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:527: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:527"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:527: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:527"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }




{ set +x
$as_echo "$at_srcdir/c++.at:527: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:527"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:527: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:527"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:527:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:527"
( $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/c++.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:527: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:527"
( $at_check_trace; 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/c++.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_436
#AT_START_437
at_fn_group_banner 437 'c++.at:530' \
  "Syntactically invalid namespace references" "     " 20
at_xfail=no
(
  $as_echo "437. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {:foo:bar}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const :foo:bar::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
:foo:bar::parser::error (const :foo:bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  :foo:bar::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
$as_echo "$at_srcdir/c++.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:531"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:531"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:531: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:531"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:531: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:531"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:531: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:531"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo: :bar}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo: :bar::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo: :bar::parser::error (const foo: :bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo: :bar::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
$as_echo "$at_srcdir/c++.at:532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:532"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:532: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:532"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:532: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:532"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:532: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:532"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:532: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:532"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }






# This one is interesting because '[3]' is encoded as '[3]', which
# contains single occurrences of ':'.

cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo[3]::bar::baz}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo[3]::bar::baz::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo[3]::bar::baz::parser::error (const foo[3]::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo[3]::bar::baz::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
$as_echo "$at_srcdir/c++.at:535: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:535"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:535: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:535"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:535: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:535"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:535: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:535"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:535: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:535"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo::bar,baz}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo::bar,baz::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar,baz::parser::error (const foo::bar,baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo::bar,baz::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
$as_echo "$at_srcdir/c++.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:536"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:536: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:536"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:536: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:536"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:536: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:536"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:536: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:536"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%define api.namespace {foo::bar::(baz /* Pacify Emacs ) */}
%union { int i; }
%define global_tokens_and_yystype
%locations

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval, const foo::bar::(baz /* Pacify Emacs ) */::parser::location_type*) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar::(baz /* Pacify Emacs ) */::parser::error (const foo::bar::(baz /* Pacify Emacs ) */::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
  foo::bar::(baz /* Pacify Emacs ) */::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
$as_echo "$at_srcdir/c++.at:537: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:537"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:537"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:537: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:537"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:537"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:537: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:537"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:537"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:537: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:537"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:537"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:537: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:537"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:537"
$at_failed && at_fn_log_failure
$at_traceon; }






  set +x
  $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 'c++.at:550' \
  "Syntax error discarding no lookahead" "           " 20
at_xfail=no
(
  $as_echo "438. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"

%code {
  #include <string>
  int yylex (yy::parser::semantic_type *);
  #define USE(Args)
}

%define parse.error verbose

%nonassoc 'a' ;

%destructor {
  std::cerr << "Discarding 'a'." << std::endl;
} 'a'

%%

start: error-reduce consistent-error 'a' { USE ($3); };

error-reduce:
  'a' 'a' consistent-error 'a' { USE (($1, $2, $4)); }
| 'a' error { std::cerr << "Reducing 'a'." << std::endl; USE ($1); }
;

consistent-error:
  'a'
| /*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 ;

%%

int
yylex (yy::parser::semantic_type *)
{
  static char const *input = "aa";
  return *input++;
}

void
yy::parser::error (const std::string &m)
{
  std::cerr << m << std::endl;
}

#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
$as_echo "$at_srcdir/c++.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:607"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:607: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:607"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:607: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:607"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:607: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:607"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:607: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:607"
( $at_check_trace; bison -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/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:607: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:607"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:607: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:607"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }

# This used to print "Discarding 'a'." again at the end.
{ set +x
$as_echo "$at_srcdir/c++.at:609:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:609"
( $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/c++.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:609: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:609"
( $at_check_trace; sed >&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"; $as_echo "syntax error
Discarding 'a'.
Reducing 'a'.
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'c++.at:623' \
  "Syntax error as exception" "                      " 20
at_xfail=no
(
  $as_echo "439. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"

%code
{
  #include <cstdlib>
  int yylex (yy::parser::semantic_type *);
}

%define api.value.type variant
%define parse.error verbose
%define parse.trace
%%

start:
  thing
| start thing
;

thing:
  error   { std::cerr << "caught error" << std::endl; }
| item
;

item:
  'a'
| 's'
  {
    throw yy::parser::syntax_error ("invalid expression");
  }

%%

int
yylex (yy::parser::semantic_type *)
{
  // 's': syntax error, 'l': lexical error.
  static char const *input = "asal";
  switch (int res = *input++)
  {
    case 'l':
      throw yy::parser::syntax_error ("invalid character");
    default:
      return res;
  }
}

void
yy::parser::error (const std::string &m)
{
  std::cerr << "error: " << m << std::endl;
}
#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
$as_echo "$at_srcdir/c++.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:682"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:682: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:682"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:682: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:682"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:682: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:682"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:682: bison -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:682"
( $at_check_trace; bison -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/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:682: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:682"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:682: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:682"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:682"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:684:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:684"
( $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/c++.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:684: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:684"
( $at_check_trace; sed >&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"; $as_echo "error: invalid expression
caught error
error: invalid character
caught error
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:684"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'c++.at:973' \
  "Exception safety with error recovery " "          " 20
at_xfail=no
(
  $as_echo "440. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >exception.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include <iostream>
#include <stdexcept>

void foo()
{
  try
    {
      throw std::runtime_error("foo");
    }
  catch (...)
    {
      std::cerr << "Inner caught" << std::endl;
      throw;
    }
}

int main()
{
  try
    {
      foo();
    }
  catch (...)
    {
      std::cerr << "Outer caught" << std::endl;
      return 0;
    }
  return 1;
}
_ATEOF



{ set +x
$as_echo "$at_srcdir/c++.at:973: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:973"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:973"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

# The "empty" quadrigraph is to protect from cfg.mk's
# sc_at_parser_check.
{ set +x
$as_echo "$at_srcdir/c++.at:973: ./exception || exit 77"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; ./exception || exit 77
) >>"$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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%debug
%error-verbose

%code requires
{
  #include <cassert>
  #include <cstdlib> // size_t and getenv.
  #include <iostream>
  #include <set>
  #include <string>

  bool debug = false;

  /// A class that tracks its instances.
  struct Object
  {
    char val;

    Object ()
      : val ('?')
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (const Object& that)
      : val (that.val)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (char v)
      : val (v)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    ~Object ()
    {
      log (this, "Object::~Object");
      objects::iterator i = instances.find (this);
      // Make sure this object is alive.
      assert (i != instances.end ());
      Object::instances.erase (i);
    }

    Object& operator= (char v)
    {
      val = v;
      return *this;
    }

    // Static part.
    typedef std::set<const Object*> objects;
    static objects instances;

    static bool
    empty ()
    {
      return instances.empty ();
    }

    static void
    log (Object const *o, const std::string& msg)
    {
      if (debug)
        {
          if (o)
            std::cerr << o << "->";
          std::cerr << msg << " {";
          const char* sep = " ";
          for (objects::const_iterator i = instances.begin(),
                                       i_end = instances.end();
               i != i_end;
               ++i)
            {
              std::cerr << sep << *i;
              sep = ", ";
            }
          std::cerr << " }" << std::endl;
        }
    }
  };
}

%code
{
  #include <cassert>
  #include <cstring> // strchr
  #include <stdexcept>
  int yylex (yy::parser::semantic_type *);
  Object::objects Object::instances;
  static char const *input;
}


%union
{
  Object *obj;
}
%destructor { delete $$; } <obj>;
%printer
{
  yyo << $$ << " '" << $$->val << '\'';
  if ($$->val == 'p')
    throw std::runtime_error ("printer");
} <obj>;

%token <obj> 'a' 'E' 'e' 'p' 'R' 's' 'T'
%type  <obj> list item


%initial-action
{
  if (strchr (input, 'i'))
    throw std::runtime_error ("initial-action");
}

%%

start: list { delete $1; };

list:
  item       { $$ = $1; }
  // Right recursion to load the stack.
| item list  { $$ = $1; delete $2; }
;

item:
  'a'     { $$ = $1; }
| 'e'     { YYUSE ($$); YYUSE ($1); error ("syntax error"); }
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE ($1); $$ = $2; }
| 'R'     { $$ = YY_NULLPTR; delete $1; YYERROR; }
| 'p'     { $$ = $1; }
| 's'     { $$ = $1; throw std::runtime_error ("reduction"); }
| 'T'     { $$ = YY_NULLPTR; delete $1; YYABORT; }
| error   { $$ = new Object ('R'); yyerrok; }
;
%%

int
yylex (yy::parser::semantic_type *lvalp)
{
  // 'a': no error.
  // 'e': user action calls error.
  // 'E': syntax error, with yyerror that throws.
  // 'i': initial action throws.
  // 'l': yylex throws.
  // 'R': call YYERROR in the action
  // 's': reduction throws.
  // 'T': call YYABORT in the action
  switch (int res = *input++)
  {
  case 'l':
    throw std::runtime_error ("yylex");
  default:
    lvalp->obj = new Object (res);
    // Fall through.
  case 0:
    return res;
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  throw std::runtime_error (m);
}

int
main (int argc, const char *argv[])
{
  switch (argc)
  {
    case 2:
      input = argv[1];
      break;
    case 3:
      assert (std::string(argv[1]) == "--debug");
      debug = 1;
      input = argv[2];
      break;
    default:
      abort ();
  }

  yy::parser parser;
  debug |= !!getenv ("YYDEBUG");
  parser.set_debug_level (debug);
  int res = 2;
  try
  {
    res = parser.parse ();
  }
  catch (const std::exception& e)
  {
    std::cerr << "exception caught: " << e.what () << std::endl;
  }
  catch (...)
  {
    std::cerr << "unknown exception caught" << std::endl;
  }
  Object::log (YY_NULLPTR, "end");
  assert (Object::empty());
  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
$as_echo "$at_srcdir/c++.at:973: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc --report=all input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:973"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc --report=all 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:973: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:973"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:973: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:973"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:973: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:973"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:973: bison -fno-caret -o input.cc --report=all input.yy"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; bison -fno-caret -o input.cc --report=all 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:973"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:973"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaas"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaas
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; sed >&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"; $as_echo "exception caught: reduction
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaal"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaal
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; sed >&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"; $as_echo "exception caught: yylex
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input i"
at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input i
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; sed >&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"; $as_echo "exception caught: initial-action
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input --debug aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input --debug aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:973: grep '^exception caught: printer\$' stderr"
at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:973"
( $at_check_trace; grep '^exception caught: printer$' stderr
) >>"$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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaae"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaae
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; sed >&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"; $as_echo "exception caught: 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaaE"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaaE
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; sed >&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"; $as_echo "exception caught: syntax error, unexpected \$end, 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaaT"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaaT
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:973:  \$PREPARSER ./input aaaaR"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:973"
( $at_check_trace;  $PREPARSER ./input aaaaR
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:973: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:973"
( $at_check_trace; 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/c++.at:973"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'c++.at:974' \
  "Exception safety without error recovery " "       " 20
at_xfail=no
(
  $as_echo "441. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >exception.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include <iostream>
#include <stdexcept>

void foo()
{
  try
    {
      throw std::runtime_error("foo");
    }
  catch (...)
    {
      std::cerr << "Inner caught" << std::endl;
      throw;
    }
}

int main()
{
  try
    {
      foo();
    }
  catch (...)
    {
      std::cerr << "Outer caught" << std::endl;
      return 0;
    }
  return 1;
}
_ATEOF



{ set +x
$as_echo "$at_srcdir/c++.at:974: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:974"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:974"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

# The "empty" quadrigraph is to protect from cfg.mk's
# sc_at_parser_check.
{ set +x
$as_echo "$at_srcdir/c++.at:974: ./exception || exit 77"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; ./exception || exit 77
) >>"$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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%debug
%error-verbose

%code requires
{
  #include <cassert>
  #include <cstdlib> // size_t and getenv.
  #include <iostream>
  #include <set>
  #include <string>

  bool debug = false;

  /// A class that tracks its instances.
  struct Object
  {
    char val;

    Object ()
      : val ('?')
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (const Object& that)
      : val (that.val)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (char v)
      : val (v)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    ~Object ()
    {
      log (this, "Object::~Object");
      objects::iterator i = instances.find (this);
      // Make sure this object is alive.
      assert (i != instances.end ());
      Object::instances.erase (i);
    }

    Object& operator= (char v)
    {
      val = v;
      return *this;
    }

    // Static part.
    typedef std::set<const Object*> objects;
    static objects instances;

    static bool
    empty ()
    {
      return instances.empty ();
    }

    static void
    log (Object const *o, const std::string& msg)
    {
      if (debug)
        {
          if (o)
            std::cerr << o << "->";
          std::cerr << msg << " {";
          const char* sep = " ";
          for (objects::const_iterator i = instances.begin(),
                                       i_end = instances.end();
               i != i_end;
               ++i)
            {
              std::cerr << sep << *i;
              sep = ", ";
            }
          std::cerr << " }" << std::endl;
        }
    }
  };
}

%code
{
  #include <cassert>
  #include <cstring> // strchr
  #include <stdexcept>
  int yylex (yy::parser::semantic_type *);
  Object::objects Object::instances;
  static char const *input;
}


%union
{
  Object *obj;
}
%destructor { delete $$; } <obj>;
%printer
{
  yyo << $$ << " '" << $$->val << '\'';
  if ($$->val == 'p')
    throw std::runtime_error ("printer");
} <obj>;

%token <obj> 'a' 'E' 'e' 'p' 'R' 's' 'T'
%type  <obj> list item


%initial-action
{
  if (strchr (input, 'i'))
    throw std::runtime_error ("initial-action");
}

%%

start: list { delete $1; };

list:
  item       { $$ = $1; }
  // Right recursion to load the stack.
| item list  { $$ = $1; delete $2; }
;

item:
  'a'     { $$ = $1; }
| 'e'     { YYUSE ($$); YYUSE ($1); error ("syntax error"); }
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE ($1); $$ = $2; }
| 'R'     { $$ = YY_NULLPTR; delete $1; YYERROR; }
| 'p'     { $$ = $1; }
| 's'     { $$ = $1; throw std::runtime_error ("reduction"); }
| 'T'     { $$ = YY_NULLPTR; delete $1; YYABORT; }

;
%%

int
yylex (yy::parser::semantic_type *lvalp)
{
  // 'a': no error.
  // 'e': user action calls error.
  // 'E': syntax error, with yyerror that throws.
  // 'i': initial action throws.
  // 'l': yylex throws.
  // 'R': call YYERROR in the action
  // 's': reduction throws.
  // 'T': call YYABORT in the action
  switch (int res = *input++)
  {
  case 'l':
    throw std::runtime_error ("yylex");
  default:
    lvalp->obj = new Object (res);
    // Fall through.
  case 0:
    return res;
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  throw std::runtime_error (m);
}

int
main (int argc, const char *argv[])
{
  switch (argc)
  {
    case 2:
      input = argv[1];
      break;
    case 3:
      assert (std::string(argv[1]) == "--debug");
      debug = 1;
      input = argv[2];
      break;
    default:
      abort ();
  }

  yy::parser parser;
  debug |= !!getenv ("YYDEBUG");
  parser.set_debug_level (debug);
  int res = 2;
  try
  {
    res = parser.parse ();
  }
  catch (const std::exception& e)
  {
    std::cerr << "exception caught: " << e.what () << std::endl;
  }
  catch (...)
  {
    std::cerr << "unknown exception caught" << std::endl;
  }
  Object::log (YY_NULLPTR, "end");
  assert (Object::empty());
  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
$as_echo "$at_srcdir/c++.at:974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc --report=all input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc --report=all 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:974: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:974"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:974: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:974"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:974: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:974"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:974: bison -fno-caret -o input.cc --report=all input.yy"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; bison -fno-caret -o input.cc --report=all 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:974"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:974"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaas"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaas
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; sed >&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"; $as_echo "exception caught: reduction
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaal"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaal
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; sed >&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"; $as_echo "exception caught: yylex
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input i"
at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input i
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; sed >&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"; $as_echo "exception caught: initial-action
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input --debug aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input --debug aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:974: grep '^exception caught: printer\$' stderr"
at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:974"
( $at_check_trace; grep '^exception caught: printer$' stderr
) >>"$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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaae"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaae
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; sed >&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"; $as_echo "exception caught: 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaaE"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaaE
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; sed >&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"; $as_echo "exception caught: syntax error, unexpected \$end, 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaaT"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaaT
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:974:  \$PREPARSER ./input aaaaR"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:974"
( $at_check_trace;  $PREPARSER ./input aaaaR
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:974: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:974"
( $at_check_trace; 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/c++.at:974"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'c++.at:975' \
  "Exception safety with error recovery api.value.type=variant" "" 20
at_xfail=no
(
  $as_echo "442. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >exception.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include <iostream>
#include <stdexcept>

void foo()
{
  try
    {
      throw std::runtime_error("foo");
    }
  catch (...)
    {
      std::cerr << "Inner caught" << std::endl;
      throw;
    }
}

int main()
{
  try
    {
      foo();
    }
  catch (...)
    {
      std::cerr << "Outer caught" << std::endl;
      return 0;
    }
  return 1;
}
_ATEOF



{ set +x
$as_echo "$at_srcdir/c++.at:975: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:975"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:975"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

# The "empty" quadrigraph is to protect from cfg.mk's
# sc_at_parser_check.
{ set +x
$as_echo "$at_srcdir/c++.at:975: ./exception || exit 77"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; ./exception || exit 77
) >>"$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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%debug
%error-verbose
%define api.value.type variant
%code requires
{
  #include <cassert>
  #include <cstdlib> // size_t and getenv.
  #include <iostream>
  #include <set>
  #include <string>

  bool debug = false;

  /// A class that tracks its instances.
  struct Object
  {
    char val;

    Object ()
      : val ('?')
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (const Object& that)
      : val (that.val)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (char v)
      : val (v)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    ~Object ()
    {
      log (this, "Object::~Object");
      objects::iterator i = instances.find (this);
      // Make sure this object is alive.
      assert (i != instances.end ());
      Object::instances.erase (i);
    }

    Object& operator= (char v)
    {
      val = v;
      return *this;
    }

    // Static part.
    typedef std::set<const Object*> objects;
    static objects instances;

    static bool
    empty ()
    {
      return instances.empty ();
    }

    static void
    log (Object const *o, const std::string& msg)
    {
      if (debug)
        {
          if (o)
            std::cerr << o << "->";
          std::cerr << msg << " {";
          const char* sep = " ";
          for (objects::const_iterator i = instances.begin(),
                                       i_end = instances.end();
               i != i_end;
               ++i)
            {
              std::cerr << sep << *i;
              sep = ", ";
            }
          std::cerr << " }" << std::endl;
        }
    }
  };
}

%code
{
  #include <cassert>
  #include <cstring> // strchr
  #include <stdexcept>
  int yylex (yy::parser::semantic_type *);
  Object::objects Object::instances;
  static char const *input;
}


%printer
{
  yyo << &$$ << " '" << $$.val << '\'';
  if ($$.val == 'p')
    throw std::runtime_error ("printer");
} <Object>;

%token <Object> 'a' 'E' 'e' 'p' 'R' 's' 'T'
%type  <Object> list item


%initial-action
{
  if (strchr (input, 'i'))
    throw std::runtime_error ("initial-action");
}

%%

start: list {};

list:
  item       { $$ = $1; }
  // Right recursion to load the stack.
| item list  { $$ = $1; }
;

item:
  'a'     { $$ = $1; }
| 'e'     { YYUSE ($$); YYUSE ($1); error ("syntax error"); }
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE ($1); $$ = $2; }
| 'R'     { YYERROR; }
| 'p'     { $$ = $1; }
| 's'     { $$ = $1; throw std::runtime_error ("reduction"); }
| 'T'     { YYABORT; }
| error   { $$ = Object ('R'); yyerrok; }
;
%%

int
yylex (yy::parser::semantic_type *lvalp)
{
  // 'a': no error.
  // 'e': user action calls error.
  // 'E': syntax error, with yyerror that throws.
  // 'i': initial action throws.
  // 'l': yylex throws.
  // 'R': call YYERROR in the action
  // 's': reduction throws.
  // 'T': call YYABORT in the action
  switch (int res = *input++)
  {
  case 'l':
    throw std::runtime_error ("yylex");
  default:
    lvalp->build (Object (res));
    // Fall through.
  case 0:
    return res;
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  throw std::runtime_error (m);
}

int
main (int argc, const char *argv[])
{
  switch (argc)
  {
    case 2:
      input = argv[1];
      break;
    case 3:
      assert (std::string(argv[1]) == "--debug");
      debug = 1;
      input = argv[2];
      break;
    default:
      abort ();
  }

  yy::parser parser;
  debug |= !!getenv ("YYDEBUG");
  parser.set_debug_level (debug);
  int res = 2;
  try
  {
    res = parser.parse ();
  }
  catch (const std::exception& e)
  {
    std::cerr << "exception caught: " << e.what () << std::endl;
  }
  catch (...)
  {
    std::cerr << "unknown exception caught" << std::endl;
  }
  Object::log (YY_NULLPTR, "end");
  assert (Object::empty());
  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
$as_echo "$at_srcdir/c++.at:975: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc --report=all input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:975"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc --report=all 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:975: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:975"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:975: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:975"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:975: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:975"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:975: bison -fno-caret -o input.cc --report=all input.yy"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; bison -fno-caret -o input.cc --report=all 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:975"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:975"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaas"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaas
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; sed >&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"; $as_echo "exception caught: reduction
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaal"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaal
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; sed >&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"; $as_echo "exception caught: yylex
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input i"
at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input i
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; sed >&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"; $as_echo "exception caught: initial-action
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input --debug aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input --debug aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:975: grep '^exception caught: printer\$' stderr"
at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:975"
( $at_check_trace; grep '^exception caught: printer$' stderr
) >>"$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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaae"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaae
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; sed >&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"; $as_echo "exception caught: 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaaE"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaaE
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; sed >&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"; $as_echo "exception caught: syntax error, unexpected \$end, 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaaT"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaaT
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:975:  \$PREPARSER ./input aaaaR"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:975"
( $at_check_trace;  $PREPARSER ./input aaaaR
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:975: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:975"
( $at_check_trace; 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/c++.at:975"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'c++.at:976' \
  "Exception safety without error recovery api.value.type=variant" "" 20
at_xfail=no
(
  $as_echo "443. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >exception.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include <iostream>
#include <stdexcept>

void foo()
{
  try
    {
      throw std::runtime_error("foo");
    }
  catch (...)
    {
      std::cerr << "Inner caught" << std::endl;
      throw;
    }
}

int main()
{
  try
    {
      foo();
    }
  catch (...)
    {
      std::cerr << "Outer caught" << std::endl;
      return 0;
    }
  return 1;
}
_ATEOF



{ set +x
$as_echo "$at_srcdir/c++.at:976: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:976"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exception exception.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.cc $LIBS" "c++.at:976"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exception exception.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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

# The "empty" quadrigraph is to protect from cfg.mk's
# sc_at_parser_check.
{ set +x
$as_echo "$at_srcdir/c++.at:976: ./exception || exit 77"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; ./exception || exit 77
) >>"$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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%debug
%error-verbose
%define api.value.type variant
%code requires
{
  #include <cassert>
  #include <cstdlib> // size_t and getenv.
  #include <iostream>
  #include <set>
  #include <string>

  bool debug = false;

  /// A class that tracks its instances.
  struct Object
  {
    char val;

    Object ()
      : val ('?')
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (const Object& that)
      : val (that.val)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    Object (char v)
      : val (v)
    {
      log (this, "Object::Object");
      Object::instances.insert (this);
    }

    ~Object ()
    {
      log (this, "Object::~Object");
      objects::iterator i = instances.find (this);
      // Make sure this object is alive.
      assert (i != instances.end ());
      Object::instances.erase (i);
    }

    Object& operator= (char v)
    {
      val = v;
      return *this;
    }

    // Static part.
    typedef std::set<const Object*> objects;
    static objects instances;

    static bool
    empty ()
    {
      return instances.empty ();
    }

    static void
    log (Object const *o, const std::string& msg)
    {
      if (debug)
        {
          if (o)
            std::cerr << o << "->";
          std::cerr << msg << " {";
          const char* sep = " ";
          for (objects::const_iterator i = instances.begin(),
                                       i_end = instances.end();
               i != i_end;
               ++i)
            {
              std::cerr << sep << *i;
              sep = ", ";
            }
          std::cerr << " }" << std::endl;
        }
    }
  };
}

%code
{
  #include <cassert>
  #include <cstring> // strchr
  #include <stdexcept>
  int yylex (yy::parser::semantic_type *);
  Object::objects Object::instances;
  static char const *input;
}


%printer
{
  yyo << &$$ << " '" << $$.val << '\'';
  if ($$.val == 'p')
    throw std::runtime_error ("printer");
} <Object>;

%token <Object> 'a' 'E' 'e' 'p' 'R' 's' 'T'
%type  <Object> list item


%initial-action
{
  if (strchr (input, 'i'))
    throw std::runtime_error ("initial-action");
}

%%

start: list {};

list:
  item       { $$ = $1; }
  // Right recursion to load the stack.
| item list  { $$ = $1; }
;

item:
  'a'     { $$ = $1; }
| 'e'     { YYUSE ($$); YYUSE ($1); error ("syntax error"); }
// Not just 'E', otherwise we reduce when 'E' is the lookahead, and
// then the stack is emptied, defeating the point of the test.
| 'E' 'a' { YYUSE ($1); $$ = $2; }
| 'R'     { YYERROR; }
| 'p'     { $$ = $1; }
| 's'     { $$ = $1; throw std::runtime_error ("reduction"); }
| 'T'     { YYABORT; }

;
%%

int
yylex (yy::parser::semantic_type *lvalp)
{
  // 'a': no error.
  // 'e': user action calls error.
  // 'E': syntax error, with yyerror that throws.
  // 'i': initial action throws.
  // 'l': yylex throws.
  // 'R': call YYERROR in the action
  // 's': reduction throws.
  // 'T': call YYABORT in the action
  switch (int res = *input++)
  {
  case 'l':
    throw std::runtime_error ("yylex");
  default:
    lvalp->build (Object (res));
    // Fall through.
  case 0:
    return res;
  }
}

/* A C++ error reporting function.  */
void
yy::parser::error (const std::string& m)
{
  throw std::runtime_error (m);
}

int
main (int argc, const char *argv[])
{
  switch (argc)
  {
    case 2:
      input = argv[1];
      break;
    case 3:
      assert (std::string(argv[1]) == "--debug");
      debug = 1;
      input = argv[2];
      break;
    default:
      abort ();
  }

  yy::parser parser;
  debug |= !!getenv ("YYDEBUG");
  parser.set_debug_level (debug);
  int res = 2;
  try
  {
    res = parser.parse ();
  }
  catch (const std::exception& e)
  {
    std::cerr << "exception caught: " << e.what () << std::endl;
  }
  catch (...)
  {
    std::cerr << "unknown exception caught" << std::endl;
  }
  Object::log (YY_NULLPTR, "end");
  assert (Object::empty());
  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
$as_echo "$at_srcdir/c++.at:976: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc --report=all input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:976"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc --report=all 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:976: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:976"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:976: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:976"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:976: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:976"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:976: bison -fno-caret -o input.cc --report=all input.yy"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; bison -fno-caret -o input.cc --report=all 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:976"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:976"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaas"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaas
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; sed >&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"; $as_echo "exception caught: reduction
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaal"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaal
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; sed >&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"; $as_echo "exception caught: yylex
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input i"
at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input i
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; sed >&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"; $as_echo "exception caught: initial-action
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input --debug aaaap"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input --debug aaaap
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:976: grep '^exception caught: printer\$' stderr"
at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:976"
( $at_check_trace; grep '^exception caught: printer$' stderr
) >>"$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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaae"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaae
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; sed >&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"; $as_echo "exception caught: 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaaE"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaaE
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; sed >&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"; $as_echo "exception caught: syntax error, unexpected \$end, 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaaT"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaaT
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:976:  \$PREPARSER ./input aaaaR"
at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:976"
( $at_check_trace;  $PREPARSER ./input aaaaR
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:976: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "c++.at:976"
( $at_check_trace; 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/c++.at:976"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $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 'c++.at:984' \
  "C++ GLR parser identifier shadowing" "            " 20
at_xfail=no
(
  $as_echo "444. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.yy <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%skeleton "glr.cc"

%union
{
  int ival;
}

%token <ival> ZERO;

%code
{
  int yylex (yy::parser::semantic_type *yylval);
}

%%
exp: ZERO

%%

int yylex (yy::parser::semantic_type *yylval)
{
  // Note: this argument is unused, but named on purpose.  There used to be a
  // bug with a macro that erroneously expanded this identifier to
  // yystackp->yyval.
  YYUSE (yylval);
  return yy::parser::token::ZERO;
}

void yy::parser::error (std::string const&)
{}

int main ()
{}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1022"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc 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/c++.at:1022"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:1022: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:1022"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.cc 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/c++.at:1022"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:1022: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:1022"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1022"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/c++.at:1022: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:1022"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1022"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/c++.at:1022: bison -fno-caret -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:1022"
( $at_check_trace; bison -fno-caret -o input.cc 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/c++.at:1022"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:1023: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:1023"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1023"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:1023: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:1023"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $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/c++.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_444
#AT_START_445
at_fn_group_banner 445 'java.at:360' \
  "Calculator " "                                    " 21
at_xfail=no
(
  $as_echo "445. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public


%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ( "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }



  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 ();

    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:360: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
{ set +x
$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'java.at:360' \
  "Calculator %error-verbose " "                     " 21
at_xfail=no
(
  $as_echo "446. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%error-verbose
%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ( "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }



  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 ();

    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:360: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
{ set +x
$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'java.at:360' \
  "Calculator %locations " "                         " 21
at_xfail=no
(
  $as_echo "447. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%locations
%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror (@$, "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yypos = new Position (1, 0);

  public Position getStartPos() {
    return yypos;
  }

  public Position getEndPos() {
    return yypos;
  }

  public void yyerror (Calc.Location l, String s)
{
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yypos = new Position (yypos.lineno (),
                                            yypos.token () + 1);
    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {
        yypos = new Position (yypos.lineno () + 1, 0);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:360: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
{ set +x
$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'java.at:360' \
  "Calculator %error-verbose %locations " "          " 21
at_xfail=no
(
  $as_echo "448. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%error-verbose %locations
%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror (@$, "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yypos = new Position (1, 0);

  public Position getStartPos() {
    return yypos;
  }

  public Position getEndPos() {
    return yypos;
  }

  public void yyerror (Calc.Location l, String s)
{
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yypos = new Position (yypos.lineno (),
                                            yypos.token () + 1);
    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {
        yypos = new Position (yypos.lineno () + 1, 0);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:360: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:360"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:360: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:360"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:360: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
$as_echo "java.at:360" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:360"
{ set +x
$as_echo "$at_srcdir/java.at:360: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:360"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:360:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:360"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:360: cat stderr"
at_fn_check_prepare_trace "java.at:360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:360"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'java.at:369' \
  "Calculator %lex-param { InputStream is } " "      " 21
at_xfail=no
(
  $as_echo "449. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ( "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }



  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 ();

    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:369: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
{ set +x
$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.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_449
#AT_START_450
at_fn_group_banner 450 'java.at:369' \
  "Calculator %error-verbose %lex-param { InputStream is } " "" 21
at_xfail=no
(
  $as_echo "450. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%error-verbose %lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ( "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }



  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 ();

    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:369: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
{ set +x
$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.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_450
#AT_START_451
at_fn_group_banner 451 'java.at:369' \
  "Calculator %locations %lex-param { InputStream is } " "" 21
at_xfail=no
(
  $as_echo "451. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%locations %lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror (@$, "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yypos = new Position (1, 0);

  public Position getStartPos() {
    return yypos;
  }

  public Position getEndPos() {
    return yypos;
  }

  public void yyerror (Calc.Location l, String s)
{
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yypos = new Position (yypos.lineno (),
                                            yypos.token () + 1);
    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {
        yypos = new Position (yypos.lineno () + 1, 0);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:369: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
{ set +x
$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.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_451
#AT_START_452
at_fn_group_banner 452 'java.at:369' \
  "Calculator %error-verbose %locations %lex-param { InputStream is } " "" 21
at_xfail=no
(
  $as_echo "452. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%define public

%error-verbose %locations %lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '='       /* comparison            */
%left '-' '+'
%left '*' '/'
%precedence NEG     /* negation--unary minus */
%right '^'          /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror (@$, "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yypos = new Position (1, 0);

  public Position getStartPos() {
    return yypos;
  }

  public Position getEndPos() {
    return yypos;
  }

  public void yyerror (Calc.Location l, String s)
{
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yypos = new Position (yypos.lineno (),
                                            yypos.token () + 1);
    if (ttype == st.TT_EOF)
      return EOF;

    else if (ttype == st.TT_EOL)
      {
        yypos = new Position (yypos.lineno () + 1, 0);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;
  public int token;

  public Position ()
  {
    line = 0;
    token = 0;
  }

  public Position (int l, int t)
  {
    line = l;
    token = t;
  }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString (line) + "." + Integer.toString(token);
  }

  public int lineno ()
  {
    return line;
  }

  public int token ()
  {
    return 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
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java Calc.y" "java.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:369: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:369"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:369: bison -fno-caret -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; bison -fno-caret -o Calc.java 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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
$as_echo "java.at:369" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:369"
{ set +x
$as_echo "$at_srcdir/java.at:369: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:369"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh 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 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.11: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.14: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.24: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.1-1.27: calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$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'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected number
1.1-1.10: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:369:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:369"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.8: syntax error, unexpected number
1.1-1.11: calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the', unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:369: cat stderr"
at_fn_check_prepare_trace "java.at:369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.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_452
#AT_START_453
at_fn_group_banner 453 'java.at:455' \
  "Java parser class and package names" "            " 22
at_xfail=no
(
  $as_echo "453. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:457"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:457: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:457"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:457: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:457"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:457: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:457"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:457: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:457"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:457" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:457"
$as_echo "java.at:457" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:457"
{ set +x
$as_echo "$at_srcdir/java.at:457: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:457"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:457"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:458: grep -c '^class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:458"
( $at_check_trace; grep -c '^class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:458"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%name-prefix "Prefix"
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:460: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:460"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:460: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:460"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:460" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:460"
$as_echo "java.at:460" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:460"
{ set +x
$as_echo "$at_srcdir/java.at:460: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:460"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:461: grep -c '^class PrefixParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:461"
( $at_check_trace; grep -c '^class PrefixParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:461"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define api.token.prefix {TOK_}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:463"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:463: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:463"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:463: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:463"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:463: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:463"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:463: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:463"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:463" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:463"
$as_echo "java.at:463" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:463"
{ set +x
$as_echo "$at_srcdir/java.at:463: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:463"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:463"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:464: grep -c '^.*TOK_END.*\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.*TOK_END.*$' YYParser.java" "java.at:464"
( $at_check_trace; grep -c '^.*TOK_END.*$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:464"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define parser_class_name {ParserClassName}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:466"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:466: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:466"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:466: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:466"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:466: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:466"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:466: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:466"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:466" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:466"
$as_echo "java.at:466" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:466"
{ set +x
$as_echo "$at_srcdir/java.at:466: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:466"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:466"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:467: grep -c '^class ParserClassName\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:467"
( $at_check_trace; grep -c '^class ParserClassName$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define package {user_java_package}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:469"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:469: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:469"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:469: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:469"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:469: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:469"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:469: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:469"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:469: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:469"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:469" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:469"
$as_echo "java.at:469" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:469"
{ set +x
$as_echo "$at_srcdir/java.at:469: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:469"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:470: grep -c '^package user_java_package;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:470"
( $at_check_trace; grep -c '^package user_java_package;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:470"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'java.at:479' \
  "Java parser class modifiers" "                    " 22
at_xfail=no
(
  $as_echo "454. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define abstract
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:481"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:481: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:481"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:481: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:481"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:481: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:481"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:481: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:481"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:481" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:481"
$as_echo "java.at:481" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:481"
{ set +x
$as_echo "$at_srcdir/java.at:481: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:481"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:481"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:482: grep -c '^abstract class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:482"
( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define final
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:484"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:484: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:484"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:484"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:484: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:484"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:484: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:484"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:484" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:484"
$as_echo "java.at:484" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:484"
{ set +x
$as_echo "$at_srcdir/java.at:484: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:484"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:484"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:485: grep -c '^final class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:485"
( $at_check_trace; grep -c '^final class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define strictfp
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:487"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:487: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:487"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:487"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:487: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:487"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:487: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:487"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:487" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:487"
$as_echo "java.at:487" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:487"
{ set +x
$as_echo "$at_srcdir/java.at:487: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:487"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:487"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:488: grep -c '^strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:488"
( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define abstract
%define strictfp
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:490: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:490"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:490: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:490"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:490: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:490"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:490: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:490"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:490: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:490"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:490: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:490"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:490" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:490"
$as_echo "java.at:490" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:490"
{ set +x
$as_echo "$at_srcdir/java.at:490: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:490"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:490"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:493: grep -c '^abstract strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:493"
( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:493"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define final
%define strictfp
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:495: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:495"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:495: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:495"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:495: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:495"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:495: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:495"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:495" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:495"
$as_echo "java.at:495" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:495"
{ set +x
$as_echo "$at_srcdir/java.at:495: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:495"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:498: grep -c '^final strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:498"
( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define public
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:500"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:500: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:500"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:500: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:500"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:500: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:500"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:500: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:500"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:500" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:500"
$as_echo "java.at:500" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:500"
{ set +x
$as_echo "$at_srcdir/java.at:500: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:500"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:501: grep -c '^public class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:501"
( $at_check_trace; grep -c '^public class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:501"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define public
%define abstract
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:503: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:503"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:503: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:503"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:503: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:503"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:503: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:503"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:503: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:503"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:503: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:503"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:503" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:503"
$as_echo "java.at:503" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:503"
{ set +x
$as_echo "$at_srcdir/java.at:503: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:503"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:506: grep -c '^public abstract class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:506"
( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define public
%define final
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:508"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:508: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:508"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:508: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:508"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:508: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:508"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:508: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:508"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:508: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:508"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:508" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:508"
$as_echo "java.at:508" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:508"
{ set +x
$as_echo "$at_srcdir/java.at:508: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:508"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:508"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:511: grep -c '^public final class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:511"
( $at_check_trace; grep -c '^public final class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:511"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define public
%define strictfp
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:513: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:513"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:513: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:513"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:513: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:513"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:513: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:513"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:513: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:513"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:513: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:513"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:513" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:513"
$as_echo "java.at:513" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:513"
{ set +x
$as_echo "$at_srcdir/java.at:513: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:513"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:516: grep -c '^public strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:516"
( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define public
%define abstract
%define strictfp
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:518"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:518: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:518"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:518: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:518"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:518: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:518"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:518" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:518"
$as_echo "java.at:518" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:518"
{ set +x
$as_echo "$at_srcdir/java.at:518: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:518"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:522: grep -c '^public abstract strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public abstract strictfp class YYParser$' YYParser.java" "java.at:522"
( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define public
%define final
%define strictfp
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:524: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:524"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:524: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:524"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:524: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:524"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:524: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:524"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:524: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:524"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:524: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:524"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:524" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:524"
$as_echo "java.at:524" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:524"
{ set +x
$as_echo "$at_srcdir/java.at:524: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:524"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:524"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:528: grep -c '^public final strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public final strictfp class YYParser$' YYParser.java" "java.at:528"
( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:528"
$at_failed && at_fn_log_failure
$at_traceon; }


# FIXME: Can't do a Java compile because javacomp.sh is configured for 1.3

cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define annotations {/*@Deprecated @SupressWarnings("unchecked") @SupressWarnings({"unchecked", "deprecation"}) @SupressWarnings(value={"unchecked", "deprecation"})*/}
%define public
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:531"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:531: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:531"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:531: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:531"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:531: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:531"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:531: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:531"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:531: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:531"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:531" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:531"
$as_echo "java.at:531" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:531"
{ set +x
$as_echo "$at_srcdir/java.at:531: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:531"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:531"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:534: grep -c '^/\\*@Deprecated @SupressWarnings(\"unchecked\") @SupressWarnings({\"unchecked\", \"deprecation\"}) @SupressWarnings(value={\"unchecked\", \"deprecation\"})\\*/ public class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^/\\*@Deprecated @SupressWarnings(\"unchecked\") @SupressWarnings({\"unchecked\", \"deprecation\"}) @SupressWarnings(value={\"unchecked\", \"deprecation\"})\\*/ public class YYParser$' YYParser.java" "java.at:534"
( $at_check_trace; grep -c '^/\*@Deprecated @SupressWarnings("unchecked") @SupressWarnings({"unchecked", "deprecation"}) @SupressWarnings(value={"unchecked", "deprecation"})\*/ public class YYParser$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:534"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'java.at:543' \
  "Java parser class extends and implements" "       " 22
at_xfail=no
(
  $as_echo "455. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define extends {Thread}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:545"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:545: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:545"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:545: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:545"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:545: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:545"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:545: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:545"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:545: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:545"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:545" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:545"
$as_echo "java.at:545" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:545"
{ set +x
$as_echo "$at_srcdir/java.at:545: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:545"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:545"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:546: grep -c '^class YYParser extends Thread\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:546"
( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%define implements {Cloneable}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:548"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:548: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:548"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:548: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:548"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:548: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:548"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:548: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:548"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:548: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:548"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:548" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:548"
$as_echo "java.at:548" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:548"
{ set +x
$as_echo "$at_srcdir/java.at:548: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:548"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:549: grep -c '^class YYParser implements Cloneable\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:549"
( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:549"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define extends {Thread}
%define implements {Cloneable}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:551: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:551"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:551: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:551"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:551: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:551"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:551: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:551"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:551: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:551"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:551: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:551"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:551" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:551"
$as_echo "java.at:551" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:551"
{ set +x
$as_echo "$at_srcdir/java.at:551: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:551"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:554: grep -c '^class YYParser extends Thread implements Cloneable\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java" "java.at:554"
( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:554"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'java.at:563' \
  "Java %parse-param and %lex-param" "               " 22
at_xfail=no
(
  $as_echo "456. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:565"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:565: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:565"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:565: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:565"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:565: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:565"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:565: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:565"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:565: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:565"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:565" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:565"
$as_echo "java.at:565" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:565"
{ set +x
$as_echo "$at_srcdir/java.at:565: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:565"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:566: grep -c '^ *public YYParser (Lexer yylexer) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) *$' YYParser.java" "java.at:566"
( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:566"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%parse-param {int parse_param1}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:568"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:568: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:568"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:568: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:568"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:568: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:568"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:568: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:568"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:568: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:568"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:568" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:568"
$as_echo "java.at:568" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:568"
{ set +x
$as_echo "$at_srcdir/java.at:568: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:568"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:569: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:569"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:569"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:570: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.java" "java.at:570"
( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:571: grep -c '^ *this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java" "java.at:571"
( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%parse-param {int parse_param1}
%parse-param {long parse_param2}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:573"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:573: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:573"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:573: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:573"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:573: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:573"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:573: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:573"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:573" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:573"
$as_echo "java.at:573" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:573"
{ set +x
$as_echo "$at_srcdir/java.at:573: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:573"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:576: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:576"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:577: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:577"
( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:578: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java" "java.at:578"
( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:579: grep -c '^ *this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java" "java.at:579"
( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:580: grep -c '^ *this.parse_param2 = parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java" "java.at:580"
( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:582: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:582"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:582: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:582"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:582: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:582"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:582: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:582"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:582: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:582"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:582: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:582"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:582" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:582"
$as_echo "java.at:582" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:582"
{ set +x
$as_echo "$at_srcdir/java.at:582: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:582"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:583: grep -c '^ *public YYParser () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () *$' YYParser.java" "java.at:583"
( $at_check_trace; grep -c '^ *public YYParser () *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:584: grep -c '^ *protected YYParser (Lexer yylexer) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) *$' YYParser.java" "java.at:584"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%parse-param {int parse_param1}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:586: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:586"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:586: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:586"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:586: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:586"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:586: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:586"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:586: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:586"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:586: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:586"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:586" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:586"
$as_echo "java.at:586" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:586"
{ set +x
$as_echo "$at_srcdir/java.at:586: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:586"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:588: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:588"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:588"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:589: grep -c '^ *public YYParser (int parse_param1) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1) *$' YYParser.java" "java.at:589"
( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:590: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.java" "java.at:590"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:590"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:591: grep -c '^ *this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java" "java.at:591"
( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.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"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%parse-param {int parse_param1}
%parse-param {long parse_param2}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:593"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:593"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:593: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:593"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:593: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:593"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:593: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:593"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:593: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:593"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:593" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:593"
$as_echo "java.at:593" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:593"
{ set +x
$as_echo "$at_srcdir/java.at:593: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:593"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:597: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:597"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:597"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:598: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:598"
( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:599: grep -c '^ *public YYParser (int parse_param1, *long parse_param2) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1, *long parse_param2) *$' YYParser.java" "java.at:599"
( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:600: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java" "java.at:600"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:600"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:601: grep -c '^ *this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java" "java.at:601"
( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.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"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:601"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:602: grep -c '^ *this.parse_param2 = parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java" "java.at:602"
( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.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"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"
%lex-param {char lex_param1}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }

  YYLexer (char lex_param1) {}
}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:604"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:604: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:604"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:604: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:604"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:604: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:604"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:604: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:604"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:604: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:604"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:604" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:604"
$as_echo "java.at:604" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:604"
{ set +x
$as_echo "$at_srcdir/java.at:604: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:604"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:606: grep -c '^ *public YYParser (char lex_param1) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1) *$' YYParser.java" "java.at:606"
( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:607: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:607"
( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%lex-param {char lex_param1}
%lex-param {short lex_param2}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }

  YYLexer (char lex_param1, short lex_param2) {}
}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:609"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:609: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:609"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:609: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:609"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:609: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:609"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:609" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:609"
$as_echo "java.at:609" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:609"
{ set +x
$as_echo "$at_srcdir/java.at:609: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:609"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:613: grep -c '^ *public YYParser (char lex_param1, *short lex_param2) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2) *$' YYParser.java" "java.at:613"
( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:614: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:614"
( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%parse-param {int parse_param1}
%parse-param {long parse_param2}
%lex-param {char lex_param1}
%lex-param {short lex_param2}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }

  YYLexer (char lex_param1, short lex_param2) {}
}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:616"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:616: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:616"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:616: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:616"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:616: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:616"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:616: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:616"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:616: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:616"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:616" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:616"
$as_echo "java.at:616" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:616"
{ set +x
$as_echo "$at_srcdir/java.at:616: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:616"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:622: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:622"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:623: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:623"
( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:624: grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) *$' YYParser.java" "java.at:624"
( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:624"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:625: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:625"
( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:626: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java" "java.at:626"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:627: grep -c '^ *this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java" "java.at:627"
( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.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"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:627"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:628: grep -c '^ *this.parse_param2 = parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java" "java.at:628"
( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.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"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:628"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'java.at:637' \
  "Java throws specifications" "                     " 22
at_xfail=no
(
  $as_echo "457. $at_setup_line: testing $at_desc ..."
  $at_traceon


# %define throws        - 0 1 2
# %define lex-throws    - 0 1 2
# %code lexer             0 1





















cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"




%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}


%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}

%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}

%initial-action {if (true) throw new InstantiationException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%define lex_throws {}

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}
%define lex_throws {}

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}
%define lex_throws {}
%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}
%define lex_throws {}
%initial-action {if (true) throw new InstantiationException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%define lex_throws {InterruptedException}

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}
%define lex_throws {InterruptedException}

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}
%define lex_throws {InterruptedException}
%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}
%define lex_throws {InterruptedException}
%initial-action {if (true) throw new InstantiationException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%define lex_throws {InterruptedException, IllegalAccessException}

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}
%define lex_throws {InterruptedException, IllegalAccessException}

%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}
%define lex_throws {InterruptedException, IllegalAccessException}
%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}
%define lex_throws {InterruptedException, IllegalAccessException}
%initial-action {if (true) throw new InstantiationException();}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"





%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}



%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}

%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}

%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%define lex_throws {}


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}
%define lex_throws {}


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}
%define lex_throws {}
%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}
%define lex_throws {}
%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%define lex_throws {InterruptedException}


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}
%define lex_throws {InterruptedException}


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}
%define lex_throws {InterruptedException}
%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}
%define lex_throws {InterruptedException}
%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"


%define lex_throws {InterruptedException, IllegalAccessException}


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {}
%define lex_throws {InterruptedException, IllegalAccessException}


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException}
%define lex_throws {InterruptedException, IllegalAccessException}
%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define throws {ClassNotFoundException, InstantiationException}
%define lex_throws {InterruptedException, IllegalAccessException}
%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: END {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:697: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:697"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:697: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:697"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
$as_echo "java.at:697" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:697"
{ set +x
$as_echo "$at_srcdir/java.at:697: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:697"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:697: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:697"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/java.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'java.at:726' \
  "Java constructor init and init_throws" "          " 22
at_xfail=no
(
  $as_echo "458. $at_setup_line: testing $at_desc ..."
  $at_traceon





cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define extends {Thread}
%code init { super("Test Thread"); if (true) throw new InterruptedException(); }
%define init_throws {InterruptedException}
%lex-param {int lex_param}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:731: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:731"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:731: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:731"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:731: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:731"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:731: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:731"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:731: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:731"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:731: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:731"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:731" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:731"
$as_echo "java.at:731" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:731"
{ set +x
$as_echo "$at_srcdir/java.at:731: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:731"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:736: grep 'super(\"Test Thread\"); if (true) throw new InterruptedException();' YYParser.java"
at_fn_check_prepare_trace "java.at:736"
( $at_check_trace; grep 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java
) >>"$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/java.at:736"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define extends {Thread}
%code init { super("Test Thread"); if (true) throw new InterruptedException(); }
%define init_throws {InterruptedException}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:738: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:738"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:738: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:738"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:738: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:738"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:738: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:738"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:738: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:738"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:738: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:738"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:738" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:738"
$as_echo "java.at:738" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:738"
{ set +x
$as_echo "$at_srcdir/java.at:738: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:738"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:742: grep 'super(\"Test Thread\"); if (true) throw new InterruptedException();' YYParser.java"
at_fn_check_prepare_trace "java.at:742"
( $at_check_trace; grep 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java
) >>"$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/java.at:742"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'java.at:753' \
  "Java value, position, and location types" "       " 22
at_xfail=no
(
  $as_echo "459. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define api.value.type {java.awt.Color}
%type<java.awt.Color> start;
%define api.location.type {MyLoc}
%define api.position.type {MyPos}
%code { class MyPos {} }
%%
start: END {$$ = $<java.awt.Color>1;};
%%
class MyPos {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:755: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:755"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:755: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:755"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:755: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:755"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:755: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:755"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:755: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:755"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:755: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:755"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:755" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:755"
$as_echo "java.at:755" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:755"
{ set +x
$as_echo "$at_srcdir/java.at:755: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:755"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:755"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:761: grep 'java.awt.Color' YYParser.java"
at_fn_check_prepare_trace "java.at:761"
( $at_check_trace; grep 'java.awt.Color' YYParser.java
) >>"$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/java.at:761"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:762: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'"
at_fn_check_prepare_notrace 'a shell pipeline' "java.at:762"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position'
) >>"$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/java.at:762"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:763: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'"
at_fn_check_prepare_notrace 'a shell pipeline' "java.at:763"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location'
) >>"$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/java.at:763"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%token END "end"

%define api.value.type {java.awt.Color}
%type<java.awt.Color> start;
%define api.location.type {MyLoc}
%define api.position.type {MyPos}
%code { class MyPos {} }

%code lexer
{
  java.awt.Color yylval;
  public java.awt.Color getLVal() { return yylval; }

  public MyPos getStartPos() { return null; }
  public MyPos getEndPos()   { return null; }

  public void yyerror (MyLoc loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: END {$$ = $<java.awt.Color>1;};
%%
class MyPos {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:765: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:765"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:765: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:765"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:765: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:765"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:765: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:765"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:765: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:765"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:765: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:765"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$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/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "java.at:765" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:765"
$as_echo "java.at:765" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:765"
{ set +x
$as_echo "$at_srcdir/java.at:765: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:765"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:773: grep 'java.awt.Color' YYParser.java"
at_fn_check_prepare_trace "java.at:773"
( $at_check_trace; grep 'java.awt.Color' YYParser.java
) >>"$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/java.at:773"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:774: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'"
at_fn_check_prepare_notrace 'a shell pipeline' "java.at:774"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position'
) >>"$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/java.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:775: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'"
at_fn_check_prepare_notrace 'a shell pipeline' "java.at:775"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location'
) >>"$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/java.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'java.at:784' \
  "Java syntax error handling without error token" " " 22
at_xfail=no
(
  $as_echo "460. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >YYParser.y <<'_ATEOF'
%language "Java"

%lex-param { String s }

%code imports {
  import java.io.IOException;
}

%code lexer {
  String Input;
  int Position;

  public YYLexer (String s)
  {
    Input    = s;
    Position = 0;
  }

  public void yyerror (String s)
  {
    System.err.println (s);
  }

  public Object getLVal ()
  {
    return null;
  }

  public int yylex () throws IOException
  {
    if (Position >= Input.length ())
      return EOF;
    else
      return Input.charAt (Position++);
  }
}

%code {
  public static void main (String args []) throws IOException
  {
    YYParser p = new YYParser (args [0]);
    p.parse ();
  }
}
%%
input:
  '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
$as_echo "$at_srcdir/java.at:835: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:835"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:835"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:835: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:835"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:835"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:835: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:835"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:835"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/java.at:835: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:835"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:835"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/java.at:835: bison -fno-caret YYParser.y"
at_fn_check_prepare_trace "java.at:835"
( $at_check_trace; bison -fno-caret YYParser.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:835"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "java.at:836" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:836"
$as_echo "java.at:836" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/java.at:836"
{ set +x
$as_echo "$at_srcdir/java.at:836: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:836"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.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/java.at:836"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:837:  \$SHELL ../../../javaexec.sh YYParser aa"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser aa" "java.at:837"
( $at_check_trace;  $SHELL ../../../javaexec.sh YYParser aa
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:837"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:838:  \$SHELL ../../../javaexec.sh YYParser ab"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ab" "java.at:838"
( $at_check_trace;  $SHELL ../../../javaexec.sh YYParser ab
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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/java.at:838"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:840:  \$SHELL ../../../javaexec.sh YYParser ba"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ba" "java.at:840"
( $at_check_trace;  $SHELL ../../../javaexec.sh YYParser ba
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "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/java.at:840"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'javapush.at:168' \
  "Trivial Push Parser with api.push-pull verification" "" 23
at_xfail=no
(
  $as_echo "461. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%language "Java"


%define parser_class_name {YYParser}
%error-verbose

%code imports {
import java.io.*;
import java.util.*;
}

%%

start: 'a' 'b' 'c' ;

%%


  public class Main
  {


  static class YYerror implements YYParser.Lexer
  {
    public Object getLVal() {return null;}
    public int yylex () throws java.io.IOException { return 0; }
    public void yyerror (String msg) { System.err.println(msg); }
  }

  static YYParser parser = null;
  static YYerror yyerror = null;
  static int teststate = -1;

  static void setup()
    throws IOException
  {
      yyerror = new YYerror();
      parser = new YYParser(yyerror);
      parser.setDebugLevel(1);
      teststate = -1;
  }

  static String[] teststatename
    = new String[]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"};

  static void check(int teststate, int expected, String msg)
  {
    System.err.println("teststate="+teststatename[teststate]
                       +"; expected="+teststatename[expected]);
    if (teststate == expected)
        return;
    System.err.println("unexpected state: "+msg);
    System.exit(1);
  }


  static public void main (String[] argv)
    throws IOException
  {
      setup();

      teststate = parser.push_parse('a', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)");

      setup();

      teststate = parser.push_parse('a', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)");
      teststate = parser.push_parse('b', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)");
      teststate = parser.push_parse('c', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)");
      teststate = parser.push_parse('\0', null);
      check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)");

      /* Reuse the parser instance and cause a failure */
      teststate = parser.push_parse('b', null);
      check(teststate,YYParser.YYABORT,"push_parse('b', null)");

      System.exit(0);
  }

}

_ATEOF


# Verify that the proper procedure(s) are generated for each case.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/javapush.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dapi.push-pull=pull -o Main.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dapi.push-pull=pull -o Main.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/javapush.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/javapush.at:177: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y" "javapush.at:177"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.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/javapush.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/javapush.at:177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/javapush.at:177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/javapush.at:177: bison -fno-caret -Dapi.push-pull=pull -o Main.java input.y"
at_fn_check_prepare_trace "javapush.at:177"
( $at_check_trace; bison -fno-caret -Dapi.push-pull=pull -o Main.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/javapush.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/javapush.at:178: grep -c '^.*public boolean parse ().*\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:178"
( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }

# If BISON_USE_PUSH_FOR_PULL is set, then we have one occurrence of
# this function, otherwise it should not be there.
{ set +x
$as_echo "$at_srcdir/javapush.at:183: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:183"
( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.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"; $as_echo "${BISON_USE_PUSH_FOR_PULL-0}
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:183"
$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
$as_echo "$at_srcdir/javapush.at:187: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dapi.push-pull=both -o Main.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:187"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dapi.push-pull=both -o Main.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/javapush.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/javapush.at:187: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y" "javapush.at:187"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.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/javapush.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/javapush.at:187: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:187"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/javapush.at:187: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:187"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/javapush.at:187: bison -fno-caret -Dapi.push-pull=both -o Main.java input.y"
at_fn_check_prepare_trace "javapush.at:187"
( $at_check_trace; bison -fno-caret -Dapi.push-pull=both -o Main.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/javapush.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/javapush.at:188: grep -c '^.*public boolean parse ().*\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:188"
( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/javapush.at:191: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:191"
( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:191"
$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
$as_echo "$at_srcdir/javapush.at:195: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:195"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.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/javapush.at:195"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/javapush.at:195: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" "javapush.at:195"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.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/javapush.at:195"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/javapush.at:195: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:195"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/javapush.at:195: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:195"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:195"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/javapush.at:195: bison -fno-caret -Dapi.push-pull=push -o Main.java input.y"
at_fn_check_prepare_trace "javapush.at:195"
( $at_check_trace; bison -fno-caret -Dapi.push-pull=push -o Main.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/javapush.at:195"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/javapush.at:196: grep -c '^.*public boolean parse ().*\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:196"
( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.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"; $as_echo "0
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:196"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/javapush.at:199: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:199"
( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:199"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "javapush.at:203" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:203"
$as_echo "javapush.at:203" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:203"
{ set +x
$as_echo "$at_srcdir/javapush.at:203: \$SHELL ../../../javacomp.sh Main.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Main.java" "javapush.at:203"
( $at_check_trace; $SHELL ../../../javacomp.sh Main.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/javapush.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/javapush.at:204:  \$SHELL ../../../javaexec.sh Main"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Main" "javapush.at:204"
( $at_check_trace;  $SHELL ../../../javaexec.sh Main
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr captured; cp "$at_stderr" stderr
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:204"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'javapush.at:213' \
  "Trivial Push Parser with %initial-action" "       " 23
at_xfail=no
(
  $as_echo "462. $at_setup_line: testing $at_desc ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%language "Java"
%initial-action {
System.err.println("Initial action invoked");
}


%define parser_class_name {YYParser}
%error-verbose

%code imports {
import java.io.*;
import java.util.*;
}

%%

start: 'a' 'b' 'c' ;

%%


  public class Main
  {


  static class YYerror implements YYParser.Lexer
  {
    public Object getLVal() {return null;}
    public int yylex () throws java.io.IOException { return 0; }
    public void yyerror (String msg) { System.err.println(msg); }
  }

  static YYParser parser = null;
  static YYerror yyerror = null;
  static int teststate = -1;

  static void setup()
    throws IOException
  {
      yyerror = new YYerror();
      parser = new YYParser(yyerror);
      parser.setDebugLevel(1);
      teststate = -1;
  }

  static String[] teststatename
    = new String[]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"};

  static void check(int teststate, int expected, String msg)
  {
    System.err.println("teststate="+teststatename[teststate]
                       +"; expected="+teststatename[expected]);
    if (teststate == expected)
        return;
    System.err.println("unexpected state: "+msg);
    System.exit(1);
  }


  static public void main (String[] argv)
    throws IOException
  {
      setup();

      teststate = parser.push_parse('a', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)");
      teststate = parser.push_parse('b', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)");
      teststate = parser.push_parse('c', null);
      check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)");
      teststate = parser.push_parse('\0', null);
      check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)");

      System.exit(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
$as_echo "$at_srcdir/javapush.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:222"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dapi.push-pull=push -o Main.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/javapush.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/javapush.at:222: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" "javapush.at:222"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.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/javapush.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/javapush.at:222: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:222"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/javapush.at:222: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:222"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/javapush.at:222: bison -fno-caret -Dapi.push-pull=push -o Main.java input.y"
at_fn_check_prepare_trace "javapush.at:222"
( $at_check_trace; bison -fno-caret -Dapi.push-pull=push -o Main.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/javapush.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/javapush.at:223: grep -c '^System.err.println(\"Initial action invoked\");\$' Main.java"
at_fn_check_prepare_dynamic "grep -c '^System.err.println(\"Initial action invoked\");$' Main.java" "javapush.at:223"
( $at_check_trace; grep -c '^System.err.println("Initial action invoked");$' Main.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }


$as_echo "javapush.at:225" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:225"
$as_echo "javapush.at:225" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:225"
{ set +x
$as_echo "$at_srcdir/javapush.at:225: \$SHELL ../../../javacomp.sh Main.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Main.java" "javapush.at:225"
( $at_check_trace; $SHELL ../../../javacomp.sh Main.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/javapush.at:225"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/javapush.at:226:  \$SHELL ../../../javaexec.sh Main"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Main" "javapush.at:226"
( $at_check_trace;  $SHELL ../../../javaexec.sh Main
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr captured; cp "$at_stderr" stderr
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }

# Verify that initial action is called exactly once.
{ set +x
$as_echo "$at_srcdir/javapush.at:228: grep -c '^Initial action invoked\$' stderr"
at_fn_check_prepare_dynamic "grep -c '^Initial action invoked$' stderr" "javapush.at:228"
( $at_check_trace; grep -c '^Initial action invoked$' 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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:228"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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 'javapush.at:311' \
  "Calc parser with api.push-pull both" "            " 23
at_xfail=no
(
  $as_echo "463. $at_setup_line: testing $at_desc ..."
  $at_traceon



# Define the calculator input.
# Warning: if you changes the input file
# then the locations test file position numbers
# may be incorrect and you will have
# to modify that file as well.

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


# Compose pieces to build the actual .y file.
cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}

%code {
static class UserLexer implements Calc.Lexer
{
  StreamTokenizer st;
  StringReader rdr;

  public UserLexer(StringReader reader)
  {
    rdr = reader;
    st = new StreamTokenizer(rdr);
    st.resetSyntax();
    st.eolIsSignificant(true);
    st.whitespaceChars(9, 9);
    st.whitespaceChars(32, 32);
    st.wordChars(48, 57);
  }

  Integer yylval;

  public Object getLVal() { return yylval; }

  public void yyerror(String msg) { System.err.println(msg); }

  public int yylex () throws IOException
  {
    switch (st.nextToken()) {
    case StreamTokenizer.TT_EOF: return EOF;
    case StreamTokenizer.TT_EOL: return (int) '\n';
    case StreamTokenizer.TT_WORD:
        yylval = new Integer (st.sval);
        return NUM;
    default: return st.ttype;
    }
  }
}

}

%code {
public static void main (String[] argv)
      throws IOException
{
    StringReader reader = getinput(argv[0]);
    UserLexer lexer = new UserLexer(reader);
    Calc calc = new Calc(lexer);
    calc.setDebugLevel(1);
    calc.parse();
}//main

}


%code imports {
  import java.io.*;
}

%code {
  static StringReader
  getinput(String filename) throws IOException
  {
    StringBuilder buf = new StringBuilder();
    FileReader file = new FileReader(filename);
    int c;
    while ((c=file.read()) > 0)
      buf.append((char)c);
    file.close();
    return new StringReader(buf.toString());
  }
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
        {System.out.println("total = "+$1);}
| error '\n'
;

exp:
  NUM                { $$ = $1;}
| exp '=' exp
  {
    if ($1.intValue() != $3.intValue())
      yyerror ( "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp
    { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp
    { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp
    { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp
    { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG
    { $$ = new Integer (-$2.intValue ());                    }
| exp '^' exp
    { $$ = new Integer ((int)Math.pow ($1.intValue (),
                                         $3.intValue ()));     }
| '(' exp ')'        { $$ = $2;}
| '(' error ')'      { $$ = new Integer (1111);}
| '!'                { $$ = new Integer (0); return YYERROR;}
| '-' error          { $$ = new Integer (0); return YYERROR;}
;


_ATEOF


# This data was captured from running a pull parser.
cat >expout <<'_ATEOF'
Stack now 0
Stack now 0 2
Stack now 0 9
Stack now 0 9 19
Stack now 0 9 19 2
Stack now 0 9 19 28
Stack now 0 9 19 28 20
Stack now 0 9 19 28 20 2
Stack now 0 9 19 28 20 29
Stack now 0 9 19 28
Stack now 0 9
Stack now 0 9 17
Stack now 0 9 17 2
Stack now 0 9 17 26
Stack now 0 9
Stack now 0 9 23
Stack now 0 8
Stack now 0 7
Stack now 0 7 2
Stack now 0 7 9
Stack now 0 7 9 19
Stack now 0 7 9 19 2
Stack now 0 7 9 19 28
Stack now 0 7 9 19 28 20
Stack now 0 7 9 19 28 20 3
Stack now 0 7 9 19 28 20 3 2
Stack now 0 7 9 19 28 20 3 12
Stack now 0 7 9 19 28 20 29
Stack now 0 7 9 19 28
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 3
Stack now 0 7 9 17 3 2
Stack now 0 7 9 17 3 12
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 4
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 3
Stack now 0 7 3 2
Stack now 0 7 3 12
Stack now 0 7 3 12 22
Stack now 0 7 3 12 22 2
Stack now 0 7 3 12 22 31
Stack now 0 7 3 12
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 3
Stack now 0 7 9 17 3 2
Stack now 0 7 9 17 3 12
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 5
Stack now 0 7 5 3
Stack now 0 7 5 3 2
Stack now 0 7 5 3 12
Stack now 0 7 5 14
Stack now 0 7 5 14 25
Stack now 0 7 9
Stack now 0 7 9 22
Stack now 0 7 9 22 2
Stack now 0 7 9 22 31
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 2
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 4
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 3
Stack now 0 7 3 3
Stack now 0 7 3 3 3
Stack now 0 7 3 3 3 2
Stack now 0 7 3 3 3 12
Stack now 0 7 3 3 12
Stack now 0 7 3 12
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 3
Stack now 0 7 9 17 3 2
Stack now 0 7 9 17 3 12
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 4
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 2
Stack now 0 7 9
Stack now 0 7 9 18
Stack now 0 7 9 18 2
Stack now 0 7 9 18 27
Stack now 0 7 9
Stack now 0 7 9 18
Stack now 0 7 9 18 2
Stack now 0 7 9 18 27
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 3
Stack now 0 7 9 17 3 2
Stack now 0 7 9 17 3 12
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 2
Stack now 0 7 9
Stack now 0 7 9 18
Stack now 0 7 9 18 5
Stack now 0 7 9 18 5 2
Stack now 0 7 9 18 5 14
Stack now 0 7 9 18 5 14 18
Stack now 0 7 9 18 5 14 18 2
Stack now 0 7 9 18 5 14 18 27
Stack now 0 7 9 18 5 14
Stack now 0 7 9 18 5 14 25
Stack now 0 7 9 18 27
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 2
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 4
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 2
Stack now 0 7 9
Stack now 0 7 9 22
Stack now 0 7 9 22 2
Stack now 0 7 9 22 31
Stack now 0 7 9 22 31 22
Stack now 0 7 9 22 31 22 2
Stack now 0 7 9 22 31 22 31
Stack now 0 7 9 22 31
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 2
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 5
Stack now 0 7 5 2
Stack now 0 7 5 14
Stack now 0 7 5 14 22
Stack now 0 7 5 14 22 2
Stack now 0 7 5 14 22 31
Stack now 0 7 5 14
Stack now 0 7 5 14 25
Stack now 0 7 9
Stack now 0 7 9 22
Stack now 0 7 9 22 2
Stack now 0 7 9 22 31
Stack now 0 7 9
Stack now 0 7 9 17
Stack now 0 7 9 17 2
Stack now 0 7 9 17 26
Stack now 0 7 9
Stack now 0 7 9 23
Stack now 0 7 16
Stack now 0 7
Stack now 0 7 15
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/javapush.at:579: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:579"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java 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/javapush.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/javapush.at:579: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" "javapush.at:579"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java 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/javapush.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/javapush.at:579: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:579"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/javapush.at:579: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:579"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/javapush.at:579: bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y"
at_fn_check_prepare_trace "javapush.at:579"
( $at_check_trace; bison -fno-caret -Dapi.push-pull=both -o Calc.java 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/javapush.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "javapush.at:580" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:580"
$as_echo "javapush.at:580" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:580"
{ set +x
$as_echo "$at_srcdir/javapush.at:580: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "javapush.at:580"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/javapush.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }

#Verify that this is a push parser.
{ set +x
$as_echo "$at_srcdir/javapush.at:582: grep -c '^.*public void push_parse_initialize().*\$' Calc.java"
at_fn_check_prepare_dynamic "grep -c '^.*public void push_parse_initialize().*$' Calc.java" "javapush.at:582"
( $at_check_trace; grep -c '^.*public void push_parse_initialize().*$' Calc.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }

# Capture stderr output for comparison purposes.
{ set +x
$as_echo "$at_srcdir/javapush.at:585:  \$SHELL ../../../javaexec.sh Calc input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc input" "javapush.at:585"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr captured; cp "$at_stderr" stderr

at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:585"
$at_failed && at_fn_log_failure
$at_traceon; }

# Extract the "Stack Now" lines from the error output,
# send them to stdout (via the sed command) and compare to expout.
# NOTE: because the target is "expout", this macro automatically
# compares the output of the sed command with the contents of
# the file "expout" (defined above).
{ set +x
$as_echo "$at_srcdir/javapush.at:591: sed -e '/^Stack now.*\$/p' -e d ./stderr"
at_fn_check_prepare_dynamic "sed -e '/^Stack now.*$/p' -e d ./stderr" "javapush.at:591"
( $at_check_trace; sed -e '/^Stack now.*$/p' -e d ./stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter

$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.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_463
#AT_START_464
at_fn_group_banner 464 'javapush.at:599' \
  "Calc parser with %locations %code lexer and api.push-pull both" "" 23
at_xfail=no
(
  $as_echo "464. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc.  */
%language "Java"
%name-prefix "Calc"
%define parser_class_name {Calc}
%lex-param { Reader rdr }
%locations

%code imports {
  import java.io.*;
}

%code lexer {
  StreamTokenizer st;
  Integer yylval;

  public YYLexer(Reader rdr)
  {
    st = new StreamTokenizer(rdr);
    st.resetSyntax();
    st.eolIsSignificant(true);
    st.whitespaceChars(9, 9);
    st.whitespaceChars(32, 32);
    st.wordChars(48, 57);
  }

  Position yypos = new Position (1, 0);

  public Position getStartPos() { return yypos; }

  public Position getEndPos() { return yypos; }

  public Object getLVal() { return yylval; }

  public void yyerror(Location loc, String msg)
  {
    System.err.println(loc+":"+msg);
  }

  public int yylex () throws IOException
  {
    yypos = new Position (yypos.lineno (),yypos.token () + 1);
    switch (st.nextToken()) {
    case StreamTokenizer.TT_EOF:
        return EOF;
    case StreamTokenizer.TT_EOL:
        yypos = new Position (yypos.lineno () + 1, 0);
        return (int) '\n';
    case StreamTokenizer.TT_WORD:
        yylval = new Integer (st.sval);
        return NUM;
    default:
      return st.ttype;
    }
  }
}

%code {
class Position {
  public int line;
  public int token;

  public Position () { line = 0; token = 0; }

  public Position (int l, int t) { line = l; token = t; }

  public boolean equals (Position l)
  {
    return l.line == line && l.token == token;
  }

  public String toString ()
  {
    return Integer.toString(line)  + "." + Integer.toString(token);
  }

  public int lineno () { return line; }

  public int token () { return token; }
}//Class Position
}

%code {
public static void main (String[] argv)
        throws IOException
{
  StringReader reader = getinput(argv[0]);
  Calc calc = new Calc(reader);
  calc.setDebugLevel(1);
  calc.parse();
}
}


%code imports {
  import java.io.*;
}

%code {
  static StringReader
  getinput(String filename) throws IOException
  {
    StringBuilder buf = new StringBuilder();
    FileReader file = new FileReader(filename);
    int c;
    while ((c=file.read()) > 0)
      buf.append((char)c);
    file.close();
    return new StringReader(buf.toString());
  }
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
        {System.out.println("total = "+$1);}
| error '\n'
;

exp:
  NUM                { $$ = $1;}
| exp '=' exp
  {
    if ($1.intValue() != $3.intValue())
      yyerror ( "calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp
    { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp
    { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp
    { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp
    { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG
    { $$ = new Integer (-$2.intValue ());                    }
| exp '^' exp
    { $$ = new Integer ((int)Math.pow ($1.intValue (),
                                         $3.intValue ()));     }
| '(' exp ')'        { $$ = $2;}
| '(' error ')'      { $$ = new Integer (1111);}
| '!'                { $$ = new Integer (0); return YYERROR;}
| '-' error          { $$ = new Integer (0); return YYERROR;}
;


_ATEOF


# Define the expected calculator output.
# This should match the output from a pull parser.
cat >output <<'_ATEOF'
total = 7
total = -5
total = -1
total = 1
total = -1
total = -4
total = 2
total = 256
total = 64
_ATEOF


cat >locations <<'_ATEOF'
Next token is token "number" (1.1: 1)
Next token is token '+' (1.2: 1)
Next token is token "number" (1.3: 2)
Next token is token '*' (1.4: 2)
Next token is token "number" (1.5: 3)
Next token is token '=' (1.6: 3)
Next token is token '=' (1.6: 3)
Next token is token '=' (1.6: 3)
Next token is token "number" (1.7: 7)
Next token is token '\n' (2.0: 7)
Next token is token '\n' (2.0: 7)
Next token is token "number" (2.1: 1)
Next token is token '+' (2.2: 1)
Next token is token "number" (2.3: 2)
Next token is token '*' (2.4: 2)
Next token is token '-' (2.5: 2)
Next token is token "number" (2.6: 3)
Next token is token '=' (2.7: 3)
Next token is token '=' (2.7: 3)
Next token is token '=' (2.7: 3)
Next token is token '=' (2.7: 3)
Next token is token '-' (2.8: 3)
Next token is token "number" (2.9: 5)
Next token is token '\n' (3.0: 5)
Next token is token '\n' (3.0: 5)
Next token is token '\n' (3.0: 5)
Next token is token '\n' (4.0: 5)
Next token is token '-' (4.1: 5)
Next token is token "number" (4.2: 1)
Next token is token '^' (4.3: 1)
Next token is token "number" (4.4: 2)
Next token is token '=' (4.5: 2)
Next token is token '=' (4.5: 2)
Next token is token '=' (4.5: 2)
Next token is token '-' (4.6: 2)
Next token is token "number" (4.7: 1)
Next token is token '\n' (5.0: 1)
Next token is token '\n' (5.0: 1)
Next token is token '\n' (5.0: 1)
Next token is token '(' (5.1: 1)
Next token is token '-' (5.2: 1)
Next token is token "number" (5.3: 1)
Next token is token ')' (5.4: 1)
Next token is token ')' (5.4: 1)
Next token is token '^' (5.5: 1)
Next token is token "number" (5.6: 2)
Next token is token '=' (5.7: 2)
Next token is token '=' (5.7: 2)
Next token is token "number" (5.8: 1)
Next token is token '\n' (6.0: 1)
Next token is token '\n' (6.0: 1)
Next token is token '\n' (7.0: 1)
Next token is token '-' (7.1: 1)
Next token is token '-' (7.2: 1)
Next token is token '-' (7.3: 1)
Next token is token "number" (7.4: 1)
Next token is token '=' (7.5: 1)
Next token is token '=' (7.5: 1)
Next token is token '=' (7.5: 1)
Next token is token '=' (7.5: 1)
Next token is token '-' (7.6: 1)
Next token is token "number" (7.7: 1)
Next token is token '\n' (8.0: 1)
Next token is token '\n' (8.0: 1)
Next token is token '\n' (8.0: 1)
Next token is token '\n' (9.0: 1)
Next token is token "number" (9.1: 1)
Next token is token '-' (9.2: 1)
Next token is token "number" (9.3: 2)
Next token is token '-' (9.4: 2)
Next token is token '-' (9.4: 2)
Next token is token "number" (9.5: 3)
Next token is token '=' (9.6: 3)
Next token is token '=' (9.6: 3)
Next token is token '-' (9.7: 3)
Next token is token "number" (9.8: 4)
Next token is token '\n' (10.0: 4)
Next token is token '\n' (10.0: 4)
Next token is token '\n' (10.0: 4)
Next token is token "number" (10.1: 1)
Next token is token '-' (10.2: 1)
Next token is token '(' (10.3: 1)
Next token is token "number" (10.4: 2)
Next token is token '-' (10.5: 2)
Next token is token "number" (10.6: 3)
Next token is token ')' (10.7: 3)
Next token is token ')' (10.7: 3)
Next token is token '=' (10.8: 3)
Next token is token '=' (10.8: 3)
Next token is token "number" (10.9: 2)
Next token is token '\n' (11.0: 2)
Next token is token '\n' (11.0: 2)
Next token is token '\n' (12.0: 2)
Next token is token "number" (12.1: 2)
Next token is token '^' (12.2: 2)
Next token is token "number" (12.3: 2)
Next token is token '^' (12.4: 2)
Next token is token "number" (12.5: 3)
Next token is token '=' (12.6: 3)
Next token is token '=' (12.6: 3)
Next token is token '=' (12.6: 3)
Next token is token "number" (12.7: 256)
Next token is token '\n' (13.0: 256)
Next token is token '\n' (13.0: 256)
Next token is token '(' (13.1: 256)
Next token is token "number" (13.2: 2)
Next token is token '^' (13.3: 2)
Next token is token "number" (13.4: 2)
Next token is token ')' (13.5: 2)
Next token is token ')' (13.5: 2)
Next token is token '^' (13.6: 2)
Next token is token "number" (13.7: 3)
Next token is token '=' (13.8: 3)
Next token is token '=' (13.8: 3)
Next token is token "number" (13.9: 64)
Next token is token '\n' (14.0: 64)
Next token is token '\n' (14.0: 64)
_ATEOF


# Define the calculator input.
# Warning: if you changes the input file
# then the locations test file position numbers
# may be incorrect and you will have
# to modify that file as well.

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


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/javapush.at:851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -Dapi.push-pull=both -o Calc.java 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/javapush.at:851"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/javapush.at:851: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" "javapush.at:851"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java 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/javapush.at:851"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/javapush.at:851: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:851"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:851"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/javapush.at:851: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:851"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:851"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/javapush.at:851: bison -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y"
at_fn_check_prepare_trace "javapush.at:851"
( $at_check_trace; bison -fno-caret -Dapi.push-pull=both -o Calc.java 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/javapush.at:851"
$at_failed && at_fn_log_failure
$at_traceon; }



$as_echo "javapush.at:852" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:852"
$as_echo "javapush.at:852" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
  && at_fn_check_skip 77 "$at_srcdir/javapush.at:852"
{ set +x
$as_echo "$at_srcdir/javapush.at:852: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "javapush.at:852"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.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/javapush.at:852"
$at_failed && at_fn_log_failure
$at_traceon; }

# Verify that this is a push parser
{ set +x
$as_echo "$at_srcdir/javapush.at:854: grep -c '^.*public void push_parse_initialize().*\$' Calc.java"
at_fn_check_prepare_dynamic "grep -c '^.*public void push_parse_initialize().*$' Calc.java" "javapush.at:854"
( $at_check_trace; grep -c '^.*public void push_parse_initialize().*$' Calc.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"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }

# Capture the  stdout and stderr output for comparison purposes.
{ set +x
$as_echo "$at_srcdir/javapush.at:857:  \$SHELL ../../../javaexec.sh Calc input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc input" "javapush.at:857"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr captured; cp "$at_stderr" stderr
echo stdout captured; cp "$at_stdout" stdout
at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }

# 1. Check that the token locations are correct
{ set +x
$as_echo "$at_srcdir/javapush.at:859: cp -f ./locations ./expout"
at_fn_check_prepare_trace "javapush.at:859"
( $at_check_trace; cp -f ./locations ./expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter


at_fn_check_skip $at_status "$at_srcdir/javapush.at:859"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/javapush.at:860: sed -e '/^Next token.*\$/p' -e d ./stderr"
at_fn_check_prepare_dynamic "sed -e '/^Next token.*$/p' -e d ./stderr" "javapush.at:860"
( $at_check_trace; sed -e '/^Next token.*$/p' -e d ./stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter

$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:860"
$at_failed && at_fn_log_failure
$at_traceon; }

# 2. Check that the calculator output matches that of a pull parser
{ set +x
$as_echo "$at_srcdir/javapush.at:862: rm -f ./expout; cp -f ./output ./expout"
at_fn_check_prepare_trace "javapush.at:862"
( $at_check_trace; rm -f ./expout; cp -f ./output ./expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter


at_fn_check_skip $at_status "$at_srcdir/javapush.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/javapush.at:863: cat ./stdout"
at_fn_check_prepare_trace "javapush.at:863"
( $at_check_trace; cat ./stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter

$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/javapush.at:863"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $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 'cxx-type.at:394' \
  "GLR: Resolve ambiguity, impure, no locations" "   " 24
at_xfail=no
(
  $as_echo "465. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */



%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %dprec 1     { $$ = $1; }
     | decl      %dprec 2
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int yylex (void)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:395"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:395"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:395: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:395"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:395: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:395"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:395: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:395"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:395: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:395"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:397:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:397"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<declare>(T,x)
<init-declare>(T,y,+(z,q))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:397"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:397"
( $at_check_trace; sed >&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"; $as_echo "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/cxx-type.at:397"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:401' \
  "GLR: Resolve ambiguity, impure, locations" "      " 24
at_xfail=no
(
  $as_echo "466. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%locations

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
  static int yylex (void);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        printf ("%d.%d-%d.%d: ",
                             @2.first_line, @2.first_column,
                             @2.last_line, @2.last_column);
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %dprec 1     { $$ = $1; }
     | decl      %dprec 2
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

int yylex (void)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            yylloc.first_line = yylloc.last_line = lineNum;
            yylloc.first_column = colNum;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            yylloc.last_column = colNum-1;
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:402"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:402: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:402"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:402: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:402"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:402: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:402"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:402: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:402"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:402: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:402"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:402: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:402"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:402"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:403:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:403"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <declare>(T,x)
15.0-15.13: <init-declare>(T,y,+(z,q))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:403"
( $at_check_trace; sed >&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"; $as_echo "17.5: 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/cxx-type.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_466
#AT_START_467
at_fn_group_banner 467 'cxx-type.at:407' \
  "GLR: Resolve ambiguity, pure, no locations" "     " 24
at_xfail=no
(
  $as_echo "467. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (YYSTYPE *lvalp);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %dprec 1     { $$ = $1; }
     | decl      %dprec 2
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int yylex (YYSTYPE *lvalp)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:408"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:408: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:408"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:408: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:408"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:408: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:408"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:408: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:408"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:408: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:408"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:408"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:410:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:410"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<declare>(T,x)
<init-declare>(T,y,+(z,q))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:410: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:410"
( $at_check_trace; sed >&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"; $as_echo "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/cxx-type.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:414' \
  "GLR: Resolve ambiguity, pure, locations" "        " 24
at_xfail=no
(
  $as_echo "468. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure %locations

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (YYLTYPE const * const llocp, const char *msg);
  static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        printf ("%d.%d-%d.%d: ",
                             @2.first_line, @2.first_column,
                             @2.last_line, @2.last_column);
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %dprec 1     { $$ = $1; }
     | decl      %dprec 2
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            yylloc.first_line = yylloc.last_line = lineNum;
            yylloc.first_column = colNum;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            yylloc.last_column = colNum-1;
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:415"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:415: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:415"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:415: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:415"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:415: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:415"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:415: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:415"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:415: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:415"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:417:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:417"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <declare>(T,x)
15.0-15.13: <init-declare>(T,y,+(z,q))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:417"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:417"
( $at_check_trace; sed >&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"; $as_echo "17.5: 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/cxx-type.at:417"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:421' \
  "GLR: Merge conflicting parses, impure, no locations" "" 24
at_xfail=no
(
  $as_echo "469. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */



%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int yylex (void)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULLPTR);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:422"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:422: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:422"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:422: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:422"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:422: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:422"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:422: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:422"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:422: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:422"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:422"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:424:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:424"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<OR>(<declare>(T,x),<cast>(x,T))
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:424"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:424: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:424"
( $at_check_trace; sed >&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"; $as_echo "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/cxx-type.at:424"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:428' \
  "GLR: Merge conflicting parses, impure, locations" "" 24
at_xfail=no
(
  $as_echo "470. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%locations

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (const char *msg);
  static int yylex (void);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        printf ("%d.%d-%d.%d: ",
                             @2.first_line, @2.first_column,
                             @2.last_line, @2.last_column);
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (const char *msg)
{
  LOCATION_PRINT (stderr, (yylloc));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}

int yylex (void)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            yylloc.first_line = yylloc.last_line = lineNum;
            yylloc.first_column = colNum;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            yylloc.last_column = colNum-1;
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULLPTR);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:429"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:429: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:429"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:429: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:429"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:429: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:429"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:429: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:429"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:429: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:429"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:429"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:431:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:431"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:431"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:431"
( $at_check_trace; sed >&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"; $as_echo "17.5: 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/cxx-type.at:431"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:435' \
  "GLR: Merge conflicting parses, pure, no locations" "" 24
at_xfail=no
(
  $as_echo "471. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (YYSTYPE *lvalp);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int yylex (YYSTYPE *lvalp)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULLPTR);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:436"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:436: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:436"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:436: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:436"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:436: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:436"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:436: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:436"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:436: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:436"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:438:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:438"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<OR>(<declare>(T,x),<cast>(x,T))
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:438"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:438: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:438"
( $at_check_trace; sed >&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"; $as_echo "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/cxx-type.at:438"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:441' \
  "GLR: Merge conflicting parses, pure, locations" " " 24
at_xfail=no
(
  $as_echo "472. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure %locations

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (YYLTYPE const * const llocp, const char *msg);
  static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        printf ("%d.%d-%d.%d: ",
                             @2.first_line, @2.first_column,
                             @2.last_line, @2.last_column);
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
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)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            yylloc.first_line = yylloc.last_line = lineNum;
            yylloc.first_column = colNum;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            yylloc.last_column = colNum-1;
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULLPTR);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:442: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:442"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:442: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:442"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:442: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:442"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:442: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:442"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:442: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:442"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:444:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:444"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:444"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:444: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:444"
( $at_check_trace; sed >&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"; $as_echo "17.5: 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/cxx-type.at:444"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $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 'cxx-type.at:448' \
  "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 24
at_xfail=no
(
  $as_echo "473. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%error-verbose

%code requires
{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  #define YYSTYPE Node *
}

%code
{
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
                        char *output;
                        output = node_to_string ($2);
                        printf ("%s\n", output);
                        free (output);
                        free_node ($2);
                   }
     ;

stmt : expr ';'  %merge <stmtMerge>     { $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'        { $$ = new_nterm ("<error>", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); }
     | '@'              { YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
                        { $$ = new_nterm ("<cast>(%s,%s)", $3, $1, YY_NULLPTR); }
     | expr '+' expr    { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); }
     ;

decl : TYPENAME declarator ';'
                        { $$ = new_nterm ("<declare>(%s,%s)", $1, $2, YY_NULLPTR); }
     | TYPENAME declarator '=' expr ';'
                        { $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
                                          $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>

int
main (int argc, char **argv)
{
  assert (argc == 2); (void) argc;
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int yylex (void)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      assert (!feof (stdin));
      c = getchar ();
      switch (c)
        {
        case EOF:
          return 0;
        case '\t':
          colNum = (colNum + 7) & ~7;
          break;
        case ' ': case '\f':
          colNum += 1;
          break;
        case '\n':
          lineNum += 1;
          colNum = 0;
          break;
        default:
          {
            int tok;
            if (isalpha (c))
              {
                i = 0;

                do
                  {
                    buffer[i++] = c;
                    colNum += 1;
                    assert (i != sizeof buffer - 1);
                    c = getchar ();
                  }
                while (isalnum (c) || c == '_');

                ungetc (c, stdin);
                buffer[i++] = 0;
                tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
                yylval = new_term (strcpy ((char *) malloc (i), buffer));
              }
            else
              {
                colNum += 1;
                tok = c;
                yylval = YY_NULLPTR;
              }
            return tok;
          }
        }
    }
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
                                + strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, YY_NULLPTR);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:449: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:449"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:449: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:449"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:449: bison -fno-caret -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:449"
( $at_check_trace; bison -fno-caret -o types.c types.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/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/cxx-type.at:449: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "cxx-type.at:449"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:449: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:449"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.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/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/cxx-type.at:451:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:451"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<OR>(<declare>(T,x),<cast>(x,T))
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:451: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "cxx-type.at:451"
( $at_check_trace; sed >&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"; $as_echo "syntax error, unexpected ID, expecting '=' or '+' or ')'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.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_473
#AT_START_474
at_fn_group_banner 474 'glr-regression.at:25' \
  "Badly Collapsed GLR States" "                     " 25
at_xfail=no
(
  $as_echo "474. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr1.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Regression Test: Improper state compression */
/* Reported by Scott McPeak */

%{
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#define YYSTYPE int
static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);
%}


%glr-parser


/* -------- productions ------ */
%%

StartSymbol: E  { $$=0; }                   %merge <exprMerge>
           ;

E: E 'P' E { $$=1; printf("E -> E 'P' E\n"); }  %merge <exprMerge>
 | 'B'     { $$=2; printf("E -> 'B'\n"); }      %merge <exprMerge>
 ;



/* ---------- C code ----------- */
%%

static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
{
  (void) x0;
  (void) x1;
  printf ("<OR>\n");
  return 0;
}

const char *input = YY_NULLPTR;

int
main (int argc, const char* argv[])
{
  assert (argc == 2); (void) argc;
  input = argv[1];
  return yyparse ();
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
yylex (void)
{
  return *input++;
}
_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y" "glr-regression.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:90"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:90: bison -fno-caret -o glr-regr1.c glr-regr1.y"
at_fn_check_prepare_trace "glr-regression.at:90"
( $at_check_trace; bison -fno-caret -o glr-regr1.c glr-regr1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr1.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/glr-regression.at:90"
$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
$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Werror" "glr-regression.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.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/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:90"
( $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/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=error" "glr-regression.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.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/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Wnone -Werror" "glr-regression.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:90: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=none -Werror" "glr-regression.at:90"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr1.c glr-regr1.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:90"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:93: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:93"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:93: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr1 glr-regr1.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS" "glr-regression.at:93"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.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/glr-regression.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:94:  \$PREPARSER ./glr-regr1 BPBPB"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr1 BPBPB" "glr-regression.at:94"
( $at_check_trace;  $PREPARSER ./glr-regr1 BPBPB
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "E -> 'B'
E -> 'B'
E -> E 'P' E
E -> 'B'
E -> E 'P' E
E -> 'B'
E -> E 'P' E
E -> E 'P' E
<OR>
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:94"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:94: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:94"
( $at_check_trace; 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/glr-regression.at:94"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:112' \
  "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 25
at_xfail=no
(
  $as_echo "475. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr2a.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Regression Test: Improper handling of embedded actions and $-N  */
/* Reported by S. Eken */

%{
  #define YYSTYPE char *

  #include <ctype.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <assert.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
%}

%glr-parser

%%

command:
    's' var 't'
       { printf ("Variable: '%s'\n", $2); }
    'v' 'x' 'q'
       { free ($2); }
  | 's' var_list 't' 'e'
       { printf ("Varlist: '%s'\n", $2); free ($2); }
  | 's' var 't' var_printer 'x'
       { free ($2); }
  ;

var:
  'V'
     { $$ = $1; }
  ;

var_list:
  var
    { $$ = $1; }
  | var ',' var_list
    {
      char *s = (char *) realloc ($1, strlen ($1) + 1 + strlen ($3) + 1);
      strcat (s, ",");
      strcat (s, $3);
      free ($3);
      $$ = s;
    }
  ;

var_printer: 'v'
   { printf ("Variable: '%s'\n", $-1); }

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
FILE *input;

int
yylex (void)
{
  char buf[50];
  char *s;
  assert (!feof (stdin));
  switch (fscanf (input, " %1[a-z,]", buf))
  {
  case 1:
    return buf[0];
  case EOF:
    return 0;
  default:
    break;
  }
  if (fscanf (input, "%49s", buf) != 1)
    return 0;
  assert (strlen (buf) < sizeof buf - 1);
  s = (char *) malloc (strlen (buf) + 1);
  strcpy (s, buf);
  yylval = s;
  return 'V';
}

int
main (int argc, char **argv)
{
  int res;
  input = stdin;
  if (argc == 2 && !(input = fopen (argv[1], "r")))
    return 3;
  res = yyparse ();
  if (argc == 2 && fclose (input))
    return 4;
  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
$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y" "glr-regression.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:210"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:210: bison -fno-caret -o glr-regr2a.c glr-regr2a.y"
at_fn_check_prepare_trace "glr-regression.at:210"
( $at_check_trace; bison -fno-caret -o glr-regr2a.c glr-regr2a.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr2a.y: warning: 2 shift/reduce conflicts [-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/glr-regression.at:210"
$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
$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Werror" "glr-regression.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.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/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:210"
( $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/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=error" "glr-regression.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.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/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Wnone -Werror" "glr-regression.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:210: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=none -Werror" "glr-regression.at:210"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr2a.c glr-regr2a.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:213: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:213"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:213"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:213: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr2a glr-regr2a.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS" "glr-regression.at:213"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.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/glr-regression.at:213"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input1.txt <<'_ATEOF'
s VARIABLE_1 t v x q
_ATEOF

{ set +x
$as_echo "$at_srcdir/glr-regression.at:218:  \$PREPARSER ./glr-regr2a input1.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input1.txt" "glr-regression.at:218"
( $at_check_trace;  $PREPARSER ./glr-regr2a input1.txt
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_1'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:218: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:218"
( $at_check_trace; 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/glr-regression.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input2.txt <<'_ATEOF'
s VARIABLE_1 , ANOTHER_VARIABLE_2 t e
_ATEOF

{ set +x
$as_echo "$at_srcdir/glr-regression.at:225:  \$PREPARSER ./glr-regr2a input2.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input2.txt" "glr-regression.at:225"
( $at_check_trace;  $PREPARSER ./glr-regr2a input2.txt
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:225"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:225: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:225"
( $at_check_trace; 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/glr-regression.at:225"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input3.txt <<'_ATEOF'
s VARIABLE_3 t v x
_ATEOF

{ set +x
$as_echo "$at_srcdir/glr-regression.at:233:  \$PREPARSER ./glr-regr2a input3.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input3.txt" "glr-regression.at:233"
( $at_check_trace;  $PREPARSER ./glr-regr2a input3.txt
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_3'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:233"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:233: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:233"
( $at_check_trace; 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/glr-regression.at:233"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $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 'glr-regression.at:244' \
  "Improper merging of GLR delayed action sets" "    " 25
at_xfail=no
(
  $as_echo "476. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr3.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Regression Test: Improper merging of GLR delayed action sets.  */
/* Reported by M. Rosien */

%{
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>

static int MergeRule (int x0, int x1);
#include <stdio.h>

static void yyerror (const char *msg);
static int yylex (void);

#define RULE(x) (1 << (x))

%}

%glr-parser

%token BAD_CHAR
%token P1 P2 T1 T2 T3 T4 O1 O2

%%

S : P1 T4 O2 NT6 P2  { printf ("Result: %x\n", $4); }
;

NT1 : P1 T1 O1 T2 P2 { $$ = RULE(2); }  %merge<MergeRule>
;

NT2 : NT1             { $$ = RULE(3); } %merge<MergeRule>
    | P1 NT1 O1 T3 P2 { $$ = RULE(4); } %merge<MergeRule>
;

NT3 : T3              { $$ = RULE(5); } %merge<MergeRule>
    | P1 NT1 O1 T3 P2 { $$ = RULE(6); } %merge<MergeRule>
;

NT4 : NT3              { $$ = RULE(7); } %merge<MergeRule>
    | NT2              { $$ = RULE(8); } %merge<MergeRule>
    | P1 NT2 O1 NT3 P2 { $$ = RULE(9); } %merge<MergeRule>
;

NT5 : NT4              { $$ = RULE(10); } %merge<MergeRule>
;

NT6 : P1 NT1 O1 T3 P2  { $$ = RULE(11) | $2; } %merge<MergeRule>
    | NT5              { $$ = RULE(12) | $1; } %merge<MergeRule>
;

%%

static int
MergeRule (int x0, int x1)
{
  return x0 | x1;
}


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

FILE *input = YY_NULLPTR;

int P[] = { P1, P2 };
int O[] = { O1, O2 };
int T[] = { T1, T2, T3, T4 };

int yylex (void)
{
  char inp[3];
  assert (!feof (stdin));
  if (fscanf (input, "%2s", inp) == EOF)
    return 0;
  switch (inp[0])
    {
    case 'p': return P[inp[1] - '1'];
    case 't': return T[inp[1] - '1'];
    case 'o': return O[inp[1] - '1'];
    }
  return BAD_CHAR;
}

int
main (int argc, char* argv[])
{
  int res;
  input = stdin;
  if (argc == 2 && !(input = fopen (argv[1], "r")))
    return 3;
  res = yyparse ();
  if (argc == 2 && fclose (input))
    return 4;
  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
$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y" "glr-regression.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:343"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:343: bison -fno-caret -o glr-regr3.c glr-regr3.y"
at_fn_check_prepare_trace "glr-regression.at:343"
( $at_check_trace; bison -fno-caret -o glr-regr3.c glr-regr3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$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
$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Werror" "glr-regression.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.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/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:343"
( $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/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=error" "glr-regression.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.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/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Wnone -Werror" "glr-regression.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:343: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=none -Werror" "glr-regression.at:343"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr3.c glr-regr3.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:343"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:347: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:347"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:347"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:347: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr3 glr-regr3.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS" "glr-regression.at:347"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.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/glr-regression.at:347"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.txt <<'_ATEOF'
p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2
_ATEOF

{ set +x
$as_echo "$at_srcdir/glr-regression.at:352:  \$PREPARSER ./glr-regr3 input.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr3 input.txt" "glr-regression.at:352"
( $at_check_trace;  $PREPARSER ./glr-regr3 input.txt
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "Result: 1c04
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:352"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:352: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:352"
( $at_check_trace; 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/glr-regression.at:352"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:365' \
  "Duplicate representation of merged trees" "       " 25
at_xfail=no
(
  $as_echo "477. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr4.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%union { char *ptr; }
%type <ptr> S A A1 A2 B
%glr-parser

%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  static char *merge (YYSTYPE, YYSTYPE);
  static char *make_value (char const *, char const *);
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static char *ptrs[100];
  static char **ptrs_next = ptrs;
%}

%%

tree: S { printf ("%s\n", $1); } ;

S:
  A   %merge<merge> { $$ = make_value ("S", $1); }
  | B %merge<merge> { $$ = make_value ("S", $1); }
  ;

A:
  A1   %merge<merge> { $$ = make_value ("A", $1); }
  | A2 %merge<merge> { $$ = make_value ("A", $1); }
  ;

A1: 'a' { $$ = make_value ("A1", "'a'"); } ;
A2: 'a' { $$ = make_value ("A2", "'a'"); } ;
B:  'a' { $$ = make_value ("B", "'a'");  } ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}

int
main (void)
{
  int status = yyparse ();
  while (ptrs_next != ptrs)
    free (*--ptrs_next);
  return status;
}

static char *
make_value (char const *parent, char const *child)
{
  char const format[] = "%s <- %s";
  char *value = *ptrs_next++ =
    (char *) malloc (strlen (parent) + strlen (child) + sizeof format);
  sprintf (value, format, parent, child);
  return value;
}

static char *
merge (YYSTYPE s1, YYSTYPE s2)
{
  char const format[] = "merge{ %s and %s }";
  char *value = *ptrs_next++ =
    (char *) malloc (strlen (s1.ptr) + strlen (s2.ptr) + sizeof format);
  sprintf (value, format, s1.ptr, s2.ptr);
  return value;
}
_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y" "glr-regression.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:439"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:439"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:439: bison -fno-caret -o glr-regr4.c glr-regr4.y"
at_fn_check_prepare_trace "glr-regression.at:439"
( $at_check_trace; bison -fno-caret -o glr-regr4.c glr-regr4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr4.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$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
$as_echo "$at_srcdir/glr-regression.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Werror" "glr-regression.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.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/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr4.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:439"
( $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/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=error" "glr-regression.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.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/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Wnone -Werror" "glr-regression.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:439: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=none -Werror" "glr-regression.at:439"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr4.c glr-regr4.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:439"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:442: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:442"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:442: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr4 glr-regr4.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS" "glr-regression.at:442"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.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/glr-regression.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:444:  \$PREPARSER ./glr-regr4"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:444"
( $at_check_trace;  $PREPARSER ./glr-regr4
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "merge{ S <- merge{ A <- A1 <- 'a' and A <- A2 <- 'a' } and S <- B <- 'a' }
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:444"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:444: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:444"
( $at_check_trace; 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/glr-regression.at:444"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:456' \
  "User destructor for unresolved GLR semantic value" "" 25
at_xfail=no
(
  $as_echo "478. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr5.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */
%}

%glr-parser
%union { int value; }
%type <value> start

%destructor {
  if ($$ != MAGIC_VALUE)
    {
      fprintf (stderr, "Bad destructor call.\n");
      exit (EXIT_FAILURE);
    }
} start

%%

start:
   'a' { $$ = MAGIC_VALUE; }
   | 'a' { $$ = MAGIC_VALUE; }
   ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/glr-regression.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y" "glr-regression.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:495"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:495"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:495: bison -fno-caret -o glr-regr5.c glr-regr5.y"
at_fn_check_prepare_trace "glr-regression.at:495"
( $at_check_trace; bison -fno-caret -o glr-regr5.c glr-regr5.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr5.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$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
$as_echo "$at_srcdir/glr-regression.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Werror" "glr-regression.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.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/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr5.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:495"
( $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/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=error" "glr-regression.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.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/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Wnone -Werror" "glr-regression.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:495: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=none -Werror" "glr-regression.at:495"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr5.c glr-regr5.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:495"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:498: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:498"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:498: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr5 glr-regr5.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS" "glr-regression.at:498"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.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/glr-regression.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:500:  \$PREPARSER ./glr-regr5"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:500"
( $at_check_trace;  $PREPARSER ./glr-regr5
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:500: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:500"
( $at_check_trace; sed >&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"; $as_echo "syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:500"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:512' \
  "User destructor after an error during a split parse" "" 25
at_xfail=no
(
  $as_echo "479. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr6.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
%}

%glr-parser
%union { int value; }
%type <value> 'a'

%destructor {
  printf ("Destructor called.\n");
} 'a'

%%

start: 'a' | 'a' ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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
$as_echo "$at_srcdir/glr-regression.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y" "glr-regression.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:543"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:543"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:543: bison -fno-caret -o glr-regr6.c glr-regr6.y"
at_fn_check_prepare_trace "glr-regression.at:543"
( $at_check_trace; bison -fno-caret -o glr-regr6.c glr-regr6.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr6.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$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
$as_echo "$at_srcdir/glr-regression.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Werror" "glr-regression.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.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/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr6.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:543"
( $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/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=error" "glr-regression.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.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/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Wnone -Werror" "glr-regression.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=none -Werror" "glr-regression.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr6.c glr-regr6.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:546: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:546"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:546: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr6 glr-regr6.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS" "glr-regression.at:546"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.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/glr-regression.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:548:  \$PREPARSER ./glr-regr6"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:548"
( $at_check_trace;  $PREPARSER ./glr-regr6
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "Destructor called.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:548: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:548"
( $at_check_trace; sed >&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"; $as_echo "syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:548"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:562' \
  "Duplicated user destructor for lookahead" "       " 25
at_xfail=no
(
  $as_echo "480. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr7.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  #define YYSTACKEXPANDABLE 0
  typedef struct count_node {
    int count;
    struct count_node *prev;
  } count_node;
  static count_node *tail;
%}

%glr-parser
%union { count_node *node; }
%type <node> 'a'

%destructor {
  if ($$->count++)
    fprintf (stderr, "Destructor called on same value twice.\n");
} 'a'

%%

start:
    stack1 start
  | stack2 start
  | /* empty */
  ;
stack1: 'a' ;
stack2: 'a' ;

%%

static int
yylex (void)
{
  yylval.node = (count_node*) malloc (sizeof *yylval.node);
  if (!yylval.node)
    {
      fprintf (stderr, "Test inconclusive.\n");
      exit (EXIT_FAILURE);
    }
  yylval.node->count = 0;
  yylval.node->prev = tail;
  tail = yylval.node;
  return 'a';
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
int
main (void)
{
  int status = yyparse ();
  while (tail)
    {
      count_node *prev = tail->prev;
      free (tail);
      tail = prev;
    }
  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
$as_echo "$at_srcdir/glr-regression.at:632: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:632"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y" "glr-regression.at:632"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:632"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:632"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:632: bison -fno-caret -o glr-regr7.c glr-regr7.y"
at_fn_check_prepare_trace "glr-regression.at:632"
( $at_check_trace; bison -fno-caret -o glr-regr7.c glr-regr7.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr7.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$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
$as_echo "$at_srcdir/glr-regression.at:632: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Werror" "glr-regression.at:632"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.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/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr7.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:632"
( $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/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=error" "glr-regression.at:632"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.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/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Wnone -Werror" "glr-regression.at:632"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:632: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=none -Werror" "glr-regression.at:632"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr7.c glr-regr7.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:635: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:635"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:635: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr7 glr-regr7.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS" "glr-regression.at:635"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.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/glr-regression.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:637:  \$PREPARSER ./glr-regr7"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:637"
( $at_check_trace;  $PREPARSER ./glr-regr7
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? 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/glr-regression.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:637: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:637"
( $at_check_trace; sed >&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"; $as_echo "memory exhausted
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:637"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:651' \
  "Incorrectly initialized location for empty right-hand side in GLR" "" 25
at_xfail=no
(
  $as_echo "481. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr8.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
%}

%token T_CONSTANT
%token T_PORT
%token T_SIGNAL

%glr-parser

%%


PortClause      : T_PORT InterfaceDeclaration T_PORT
                { printf("%d/%d - %d/%d - %d/%d\n",
                         @1.first_column, @1.last_column,
                         @2.first_column, @2.last_column,
                         @3.first_column, @3.last_column); }
        ;

InterfaceDeclaration    : OptConstantWord       %dprec 1
        | OptSignalWord %dprec 2
        ;

OptConstantWord : /* empty */
        | T_CONSTANT
        ;

OptSignalWord   : /* empty */
                { printf("empty: %d/%d\n", @$.first_column, @$.last_column); }
        | T_SIGNAL
        ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int lexIndex;

int yylex (void)
{
  lexIndex += 1;
  switch (lexIndex)
    {
    default:
      abort ();
    case 1:
      yylloc.first_column = 1;
      yylloc.last_column = 9;
      return T_PORT;
    case 2:
      yylloc.first_column = 13;
      yylloc.last_column = 17;
      return T_PORT;
    case 3:
      return 0;
    }
}

#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
$as_echo "$at_srcdir/glr-regression.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y" "glr-regression.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:721"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:721"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:721: bison -fno-caret -o glr-regr8.c glr-regr8.y"
at_fn_check_prepare_trace "glr-regression.at:721"
( $at_check_trace; bison -fno-caret -o glr-regr8.c glr-regr8.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr8.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$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
$as_echo "$at_srcdir/glr-regression.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Werror" "glr-regression.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.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/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr8.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:721"
( $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/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=error" "glr-regression.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.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/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Wnone -Werror" "glr-regression.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:721: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=none -Werror" "glr-regression.at:721"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr8.c glr-regr8.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:721"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:724: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:724"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:724: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr8 glr-regr8.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS" "glr-regression.at:724"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.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/glr-regression.at:724"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:726:  \$PREPARSER ./glr-regr8"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:726"
( $at_check_trace;  $PREPARSER ./glr-regr8
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "empty: 9/9
1/9 - 9/9 - 13/17
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:726: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:726"
( $at_check_trace; 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/glr-regression.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:740' \
  "No users destructors if stack 0 deleted" "        " 25
at_xfail=no
(
  $as_echo "482. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr9.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
# include <stdio.h>
# include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
# define YYSTACKEXPANDABLE 0
  static int tokens = 0;
  static int destructors = 0;
# define USE(Var)
%}

%glr-parser
%union { int dummy; }
%type <dummy> 'a'

%destructor {
  destructors += 1;
} 'a'

%%

start:
    ambig0 'a'   { destructors += 2; USE ($2); }
  | ambig1 start { destructors += 1; }
  | ambig2 start { destructors += 1; }
  ;

ambig0: 'a' ;
ambig1: 'a' ;
ambig2: 'a' ;

%%

static int
yylex (void)
{
  tokens += 1;
  return 'a';
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
int
main (void)
{
  int exit_status;
  exit_status = yyparse ();
  if (tokens != destructors)
    {
      fprintf (stderr, "Tokens = %d, Destructors = %d\n", tokens, destructors);
      return 1;
    }
  return !exit_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
$as_echo "$at_srcdir/glr-regression.at:801: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:801"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y" "glr-regression.at:801"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:801"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:801"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:801: bison -fno-caret -o glr-regr9.c glr-regr9.y"
at_fn_check_prepare_trace "glr-regression.at:801"
( $at_check_trace; bison -fno-caret -o glr-regr9.c glr-regr9.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr9.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$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
$as_echo "$at_srcdir/glr-regression.at:801: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Werror" "glr-regression.at:801"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.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/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr9.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:801"
( $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/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=error" "glr-regression.at:801"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.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/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Wnone -Werror" "glr-regression.at:801"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:801: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=none -Werror" "glr-regression.at:801"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr9.c glr-regr9.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:801"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:804: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:804"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:804: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr9 glr-regr9.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS" "glr-regression.at:804"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.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/glr-regression.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:806:  \$PREPARSER ./glr-regr9"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:806"
( $at_check_trace;  $PREPARSER ./glr-regr9
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:806: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:806"
( $at_check_trace; sed >&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"; $as_echo "memory exhausted
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:817' \
  "Corrupted semantic options if user action cuts parse" "" 25
at_xfail=no
(
  $as_echo "483. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr10.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
# include <stdlib.h>
# include <stdio.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  #define GARBAGE_SIZE 50
  static char garbage[GARBAGE_SIZE];
%}

%glr-parser
%union { char *ptr; }
%type <ptr> start

%%

start:
    %dprec 2 { $$ = garbage; YYACCEPT; }
  | %dprec 1 { $$ = garbage; YYACCEPT; }
  ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}

int
main (void)
{
  int i;
  for (i = 0; i < GARBAGE_SIZE; i+=1)
    garbage[i] = 108;
  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
$as_echo "$at_srcdir/glr-regression.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y" "glr-regression.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:857"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:857"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:857: bison -fno-caret -o glr-regr10.c glr-regr10.y"
at_fn_check_prepare_trace "glr-regression.at:857"
( $at_check_trace; bison -fno-caret -o glr-regr10.c glr-regr10.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr10.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$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
$as_echo "$at_srcdir/glr-regression.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Werror" "glr-regression.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.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/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr10.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:857"
( $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/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=error" "glr-regression.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.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/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Wnone -Werror" "glr-regression.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=none -Werror" "glr-regression.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr10.c glr-regr10.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:860: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:860"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:860"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:860: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr10 glr-regr10.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS" "glr-regression.at:860"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.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/glr-regression.at:860"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:862:  \$PREPARSER ./glr-regr10"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr10" "glr-regression.at:862"
( $at_check_trace;  $PREPARSER ./glr-regr10
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:862: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:862"
( $at_check_trace; 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/glr-regression.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:871' \
  "Undesirable destructors if user action cuts parse" "" 25
at_xfail=no
(
  $as_echo "484. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr11.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
# include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static int destructors = 0;
# define USE(val)
%}

%glr-parser
%union { int dummy; }
%type <int> 'a'
%destructor { destructors += 1; } 'a'

%%

start:
    'a' %dprec 2 { USE ($1); destructors += 1; YYACCEPT; }
  | 'a' %dprec 1 { USE ($1); destructors += 1; YYACCEPT; }
  ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "a";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}

int
main (void)
{
  int exit_status = yyparse ();
  if (destructors != 1)
    {
      fprintf (stderr, "Destructor calls: %d\n", destructors);
      return 1;
    }
  return exit_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
$as_echo "$at_srcdir/glr-regression.at:915: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:915"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y" "glr-regression.at:915"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:915"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:915"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:915: bison -fno-caret -o glr-regr11.c glr-regr11.y"
at_fn_check_prepare_trace "glr-regression.at:915"
( $at_check_trace; bison -fno-caret -o glr-regr11.c glr-regr11.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr11.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$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
$as_echo "$at_srcdir/glr-regression.at:915: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Werror" "glr-regression.at:915"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.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/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr11.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:915"
( $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/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=error" "glr-regression.at:915"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.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/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Wnone -Werror" "glr-regression.at:915"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:915: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=none -Werror" "glr-regression.at:915"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr11.c glr-regr11.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:915"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:918: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:918"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:918"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:918: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr11 glr-regr11.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS" "glr-regression.at:918"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.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/glr-regression.at:918"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:920:  \$PREPARSER ./glr-regr11"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:920"
( $at_check_trace;  $PREPARSER ./glr-regr11
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:920"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:920: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:920"
( $at_check_trace; 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/glr-regression.at:920"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:929' \
  "Leaked semantic values if user action cuts parse" "" 25
at_xfail=no
(
  $as_echo "485. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr12.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%union { int dummy; }
%token PARENT_RHS_AFTER
%type <dummy> parent_rhs_before merged PARENT_RHS_AFTER
%destructor { parent_rhs_before_value = 0; } parent_rhs_before
%destructor { merged_value = 0; } merged
%destructor { parent_rhs_after_value = 0; } PARENT_RHS_AFTER

%{
# include <stdlib.h>
# include <assert.h>
  static int merge (YYSTYPE, YYSTYPE);
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static int parent_rhs_before_value = 0;
  static int merged_value = 0;
  static int parent_rhs_after_value = 0;
# define USE(val)
%}

%%

start:
  alt1 %dprec 1
  | alt2 %dprec 2
  ;

alt1:
  PARENT_RHS_AFTER {
    USE ($1);
    parent_rhs_after_value = 0;
  }
  ;

alt2:
  parent_rhs_before merged PARENT_RHS_AFTER {
    USE (($1, $2, $3));
    parent_rhs_before_value = 0;
    merged_value = 0;
    parent_rhs_after_value = 0;
  }
  ;

parent_rhs_before:
  {
    USE ($$);
    parent_rhs_before_value = 1;
  }
  ;

merged:
  %merge<merge> {
    USE ($$);
    merged_value = 1;
  }
  | cut %merge<merge> {
    USE ($$);
    merged_value = 1;
  }
  ;

cut: { YYACCEPT; } ;

%%

static int
merge (YYSTYPE s1, YYSTYPE s2)
{
  /* Not invoked. */
  char dummy = s1.dummy + s2.dummy;
  return dummy;
}



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static int const input[] = { PARENT_RHS_AFTER, 0 };
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == PARENT_RHS_AFTER)
    parent_rhs_after_value = 1;;
  return res;
}

int
main (void)
{
  int exit_status = yyparse ();
  if (parent_rhs_before_value)
    {
      fprintf (stderr, "'parent_rhs_before' destructor not called.\n");
      exit_status = 1;
    }
  if (merged_value)
    {
      fprintf (stderr, "'merged' destructor not called.\n");
      exit_status = 1;
    }
  if (parent_rhs_after_value)
    {
      fprintf (stderr, "'PARENT_RHS_AFTER' destructor not called.\n");
      exit_status = 1;
    }
  return exit_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
$as_echo "$at_srcdir/glr-regression.at:1036: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1036"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y" "glr-regression.at:1036"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1036"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1036"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1036: bison -fno-caret -o glr-regr12.c glr-regr12.y"
at_fn_check_prepare_trace "glr-regression.at:1036"
( $at_check_trace; bison -fno-caret -o glr-regr12.c glr-regr12.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr12.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
glr-regr12.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$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
$as_echo "$at_srcdir/glr-regression.at:1036: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Werror" "glr-regression.at:1036"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.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/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr12.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
glr-regr12.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1036"
( $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/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=error" "glr-regression.at:1036"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.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/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Wnone -Werror" "glr-regression.at:1036"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1036: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=none -Werror" "glr-regression.at:1036"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr12.c glr-regr12.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1036"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1040: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1040"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1040"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1040: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr12 glr-regr12.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS" "glr-regression.at:1040"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.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/glr-regression.at:1040"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1042:  \$PREPARSER ./glr-regr12"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1042"
( $at_check_trace;  $PREPARSER ./glr-regr12
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1042"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1042: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1042"
( $at_check_trace; 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/glr-regression.at:1042"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1053' \
  "Incorrect lookahead during deterministic GLR" "   " 25
at_xfail=no
(
  $as_echo "486. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr13.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


/* Tests:
     - Defaulted state with initial yychar: yychar == YYEMPTY.
     - Nondefaulted state: yychar != YYEMPTY.
     - Defaulted state after lookahead: yychar != YYEMPTY.
     - Defaulted state after shift: yychar == YYEMPTY.
     - User action changing the lookahead.  */

%{
  #include <stdio.h>
  #include <assert.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static void print_lookahead (char const *);
  #define USE(value)
%}

%union { char value; }
%type <value> 'a' 'b'
%glr-parser
%locations

%%

start:
  defstate_init defstate_shift 'b' change_lookahead 'a' {
    USE ($3);
    print_lookahead ("start <- defstate_init defstate_shift 'b'");
  }
  ;
defstate_init:
  {
    print_lookahead ("defstate_init <- empty string");
  }
  ;
defstate_shift:
  nondefstate defstate_look 'a' {
    USE ($3);
    print_lookahead ("defstate_shift <- nondefstate defstate_look 'a'");
  }
  ;
defstate_look:
  {
    print_lookahead ("defstate_look <- empty string");
  }
  ;
nondefstate:
  {
    print_lookahead ("nondefstate <- empty string");
  }
  | 'b' {
    USE ($1);
    print_lookahead ("nondefstate <- 'b'");
  }
  ;
change_lookahead:
  {
    yychar = 'a';
  }
  ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "ab";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  yylval.value = res + 'A' - 'a';
  return res;
}

static void
print_lookahead (char const *reduction)
{
  printf ("%s:\n  yychar=", reduction);
  if (yychar == YYEMPTY)
    printf ("YYEMPTY");
  else if (yychar == YYEOF)
    printf ("YYEOF");
  else
    {
      printf ("'%c', yylval='", yychar);
      if (yylval.value > ' ')
        printf ("%c", yylval.value);
      printf ("', yylloc=(%d,%d),(%d,%d)",
              yylloc.first_line, yylloc.first_column,
              yylloc.last_line, yylloc.last_column);
    }
  printf ("\n");
}

int
main (void)
{
  yychar = '#'; /* Not a token in the grammar.  */
  yylval.value = '!';
  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
$as_echo "$at_srcdir/glr-regression.at:1154: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1154"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1154: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y" "glr-regression.at:1154"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1154: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1154"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1154: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1154"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1154: bison -fno-caret -o glr-regr13.c glr-regr13.y"
at_fn_check_prepare_trace "glr-regression.at:1154"
( $at_check_trace; bison -fno-caret -o glr-regr13.c glr-regr13.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1154"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1155: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1155"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1155"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1155: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr13 glr-regr13.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS" "glr-regression.at:1155"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.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/glr-regression.at:1155"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1157:  \$PREPARSER ./glr-regr13"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr13" "glr-regression.at:1157"
( $at_check_trace;  $PREPARSER ./glr-regr13
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "defstate_init <- empty string:
  yychar=YYEMPTY
nondefstate <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
defstate_look <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
defstate_shift <- nondefstate defstate_look 'a':
  yychar=YYEMPTY
start <- defstate_init defstate_shift 'b':
  yychar=YYEMPTY
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1157"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1157: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1157"
( $at_check_trace; 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/glr-regression.at:1157"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1177' \
  "Incorrect lookahead during nondeterministic GLR" "" 25
at_xfail=no
(
  $as_echo "487. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr14.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


/* Tests:
     - Conflicting actions (split-off parse, which copies lookahead need,
       which is necessarily yytrue) and nonconflicting actions (non-split-off
       parse) for nondefaulted state: yychar != YYEMPTY.
     - Merged deferred actions (lookahead need and RHS from different stack
       than the target state) and nonmerged deferred actions (same stack).
     - Defaulted state after lookahead: yychar != YYEMPTY.
     - Defaulted state after shift: yychar == YYEMPTY.
     - yychar != YYEMPTY but lookahead need is yyfalse (a previous stack has
       seen the lookahead but current stack has not).
     - Exceeding stack capacity (stack explosion), and thus reallocating
       lookahead need array.
   Note that it does not seem possible to see the initial yychar value during
   nondeterministic operation since:
     - In order to preserve the initial yychar, only defaulted states may be
       entered.
     - If only defaulted states are entered, there are no conflicts, so
       nondeterministic operation does not start.  */

%union { char value; }

%{
  #include <stdlib.h>
  #include <stdio.h>
  #include <assert.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static void print_lookahead (char const *);
  static char merge (union YYSTYPE, union YYSTYPE);
  #define USE(value)
%}

%type <value> 'a' 'b' 'c' 'd' stack_explosion
%glr-parser
%locations

%%

start:
  merge 'c' stack_explosion {
    USE ($2); USE ($3);
    print_lookahead ("start <- merge 'c' stack_explosion");
  }
  ;

/* When merging the 2 deferred actions, the lookahead needs are different.  */
merge:
  nonconflict1 'a' 'b' nonconflict2 %dprec 1 {
    USE ($2); USE ($3);
    print_lookahead ("merge <- nonconflict1 'a' 'b' nonconflict2");
  }
  | conflict defstate_look 'a' nonconflict2 'b' defstate_shift %dprec 2 {
    USE ($3); USE ($5);
    print_lookahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'"
                      " defstate_shift");
  }
  ;

nonconflict1:
  {
    print_lookahead ("nonconflict1 <- empty string");
  }
  ;
nonconflict2:
  {
    print_lookahead ("nonconflict2 <- empty string");
  }
  | 'a' {
    USE ($1);
    print_lookahead ("nonconflict2 <- 'a'");
  }
  ;
conflict:
  {
    print_lookahead ("conflict <- empty string");
  }
  ;
defstate_look:
  {
    print_lookahead ("defstate_look <- empty string");
  }
  ;

/* yychar != YYEMPTY but lookahead need is yyfalse.  */
defstate_shift:
  {
    print_lookahead ("defstate_shift <- empty string");
  }
  ;

stack_explosion:
  { $$ = '\0'; }
  | alt1 stack_explosion %merge<merge> { $$ = $2; }
  | alt2 stack_explosion %merge<merge> { $$ = $2; }
  | alt3 stack_explosion %merge<merge> { $$ = $2; }
  ;
alt1:
  'd' no_look {
    USE ($1);
    if (yychar != 'd' && yychar != YYEOF)
      {
        fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
      }
  }
  ;
alt2:
  'd' no_look {
    USE ($1);
    if (yychar != 'd' && yychar != YYEOF)
      {
        fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
      }
  }
  ;
alt3:
  'd' no_look {
    USE ($1);
    if (yychar != 'd' && yychar != YYEOF)
      {
        fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
      }
  }
  ;
no_look:
  {
    if (yychar != YYEMPTY)
      {
        fprintf (stderr,
                 "Found lookahead where shouldn't during stack explosion.\n");
      }
  }
  ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
  static char const input[] = "abcdddd";
  static size_t toknum;
  assert (toknum < sizeof input);
  yylloc.first_line = yylloc.last_line = 1;
  yylloc.first_column = yylloc.last_column = toknum + 1;
  yylval.value = input[toknum] + 'A' - 'a';
  return input[toknum++];
}

static void
print_lookahead (char const *reduction)
{
  printf ("%s:\n  yychar=", reduction);
  if (yychar == YYEMPTY)
    printf ("YYEMPTY");
  else if (yychar == YYEOF)
    printf ("YYEOF");
  else
    {
      printf ("'%c', yylval='", yychar);
      if (yylval.value > ' ')
        printf ("%c", yylval.value);
      printf ("', yylloc=(%d,%d),(%d,%d)",
              yylloc.first_line, yylloc.first_column,
              yylloc.last_line, yylloc.last_column);
    }
  printf ("\n");
}

static char
merge (union YYSTYPE s1, union YYSTYPE s2)
{
  char dummy = s1.value + s2.value;
  return dummy;
}

int
main (void)
{
  yychar = '#'; /* Not a token in the grammar.  */
  yylval.value = '!';
  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
$as_echo "$at_srcdir/glr-regression.at:1367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1367"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y" "glr-regression.at:1367"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1367"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1367"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1367: bison -fno-caret -o glr-regr14.c glr-regr14.y"
at_fn_check_prepare_trace "glr-regression.at:1367"
( $at_check_trace; bison -fno-caret -o glr-regr14.c glr-regr14.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr14.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$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
$as_echo "$at_srcdir/glr-regression.at:1367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Werror" "glr-regression.at:1367"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.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/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr14.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1367"
( $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/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=error" "glr-regression.at:1367"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.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/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Wnone -Werror" "glr-regression.at:1367"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1367: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=none -Werror" "glr-regression.at:1367"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr14.c glr-regr14.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1370: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1370"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1370: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr14 glr-regr14.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS" "glr-regression.at:1370"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.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/glr-regression.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1372:  \$PREPARSER ./glr-regr14"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1372"
( $at_check_trace;  $PREPARSER ./glr-regr14
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; $as_echo "conflict <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
defstate_look <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
nonconflict2 <- empty string:
  yychar='b', yylval='B', yylloc=(1,2),(1,2)
defstate_shift <- empty string:
  yychar=YYEMPTY
merge <- conflict defstate_look 'a' nonconflict2 'b' defstate_shift:
  yychar=YYEMPTY
start <- merge 'c' stack_explosion:
  yychar=YYEOF
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1372"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1372"
( $at_check_trace; 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/glr-regression.at:1372"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1394' \
  "Leaked semantic values when reporting ambiguity" "" 25
at_xfail=no
(
  $as_echo "488. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr15.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%destructor { parent_rhs_before_value = 0; } parent_rhs_before

%{
# include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static int parent_rhs_before_value = 0;
# define USE(val)
%}

%%

start:
  alt1 %dprec 1
  | alt2 %dprec 2
  ;

/* This stack must be merged into the other stacks *last* (added at the
   beginning of the semantic options list) so that yyparse will choose to clean
   it up rather than the tree for which some semantic actions have been
   performed.  Thus, if yyreportAmbiguity longjmp's to yyparse, the values from
   those other trees are not cleaned up.  */
alt1: ;

alt2:
  parent_rhs_before ambiguity {
    USE ($1);
    parent_rhs_before_value = 0;
  }
  ;

parent_rhs_before:
  {
    USE ($$);
    parent_rhs_before_value = 1;
  }
  ;

ambiguity: ambiguity1 | ambiguity2 ;
ambiguity1: ;
ambiguity2: ;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}

int
main (void)
{
  int exit_status = yyparse () != 1;
  if (parent_rhs_before_value)
    {
      fprintf (stderr, "'parent_rhs_before' destructor not called.\n");
      exit_status = 1;
    }
  return exit_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
$as_echo "$at_srcdir/glr-regression.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y" "glr-regression.at:1460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1460: bison -fno-caret -o glr-regr15.c glr-regr15.y"
at_fn_check_prepare_trace "glr-regression.at:1460"
( $at_check_trace; bison -fno-caret -o glr-regr15.c glr-regr15.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr15.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$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
$as_echo "$at_srcdir/glr-regression.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Werror" "glr-regression.at:1460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.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/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr15.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1460"
( $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/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=error" "glr-regression.at:1460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.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/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Wnone -Werror" "glr-regression.at:1460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1460: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=none -Werror" "glr-regression.at:1460"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr15.c glr-regr15.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1460"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1463: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1463"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1463"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1463: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr15 glr-regr15.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS" "glr-regression.at:1463"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.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/glr-regression.at:1463"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1465:  \$PREPARSER ./glr-regr15"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1465"
( $at_check_trace;  $PREPARSER ./glr-regr15
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1465"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1465: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1465"
( $at_check_trace; sed >&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"; $as_echo "syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1465"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1476' \
  "Leaked lookahead after nondeterministic parse syntax error" "" 25
at_xfail=no
(
  $as_echo "489. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr16.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%destructor { lookahead_value = 0; } 'b'

%{
# include <stdlib.h>
# include <assert.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
  static int lookahead_value = 0;
# define USE(val)
%}

%%

start: alt1 'a' | alt2 'a' ;
alt1: ;
alt2: ;

%%



/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "ab";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  if (res == 'b')
    lookahead_value = 1;
  return res;
}

int
main (void)
{
  int exit_status = yyparse () != 1;
  if (lookahead_value)
    {
      fprintf (stderr, "Lookahead destructor not called.\n");
      exit_status = 1;
    }
  return exit_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
$as_echo "$at_srcdir/glr-regression.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y" "glr-regression.at:1520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1520"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1520"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1520: bison -fno-caret -o glr-regr16.c glr-regr16.y"
at_fn_check_prepare_trace "glr-regression.at:1520"
( $at_check_trace; bison -fno-caret -o glr-regr16.c glr-regr16.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr16.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$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
$as_echo "$at_srcdir/glr-regression.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Werror" "glr-regression.at:1520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.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/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr16.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1520"
( $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/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=error" "glr-regression.at:1520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.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/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Wnone -Werror" "glr-regression.at:1520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=none -Werror" "glr-regression.at:1520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr16.c glr-regr16.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1520"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1523: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1523"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1523"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1523: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr16 glr-regr16.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS" "glr-regression.at:1523"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.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/glr-regression.at:1523"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1525:  \$PREPARSER ./glr-regr16"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1525"
( $at_check_trace;  $PREPARSER ./glr-regr16
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1525: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1525"
( $at_check_trace; sed >&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"; $as_echo "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/glr-regression.at:1525"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1536' \
  "Uninitialized location when reporting ambiguity" "" 25
at_xfail=no
(
  $as_echo "490. $at_setup_line: testing $at_desc ..."
  $at_traceon




cat >glr-regr17.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%locations
%define api.pure
%error-verbose

%union { int dummy; }

%{
  #include <stdio.h>

#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static unsigned location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
#  define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif

static void yyerror (YYLTYPE const * const llocp, const char *msg);
  static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
%}

%%

/* Tests the case of an empty RHS that has inherited the location of the
   previous nonterminal, which is unresolved.  That location is reported as the
   last position of the ambiguity.  */
start: ambig1 empty1 | ambig2 empty2 ;

/* Tests multiple levels of yyresolveLocations recursion.  */
ambig1: sub_ambig1 | sub_ambig2 ;
ambig2: sub_ambig1 | sub_ambig2 ;

/* Tests the case of a non-empty RHS as well as the case of an empty RHS that
   has inherited the initial location.  The empty RHS's location is reported as
   the first position in the ambiguity.  */
sub_ambig1: empty1 'a' 'b' ;
sub_ambig2: empty2 'a' 'b' ;
empty1: ;
empty2: ;

%%
# include <assert.h>



# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static unsigned
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
  unsigned 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.  */
static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
  LOCATION_PRINT (stderr, (*llocp));
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", msg);
}
static int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static char const input[] = "ab";
  static size_t toknum;
  assert (toknum < sizeof input);
  lvalp->dummy = 0;
  llocp->first_line = llocp->last_line = 2;
  llocp->first_column = toknum + 1;
  llocp->last_column = llocp->first_column + 1;
  return input[toknum++];
}

#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
$as_echo "$at_srcdir/glr-regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y" "glr-regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1594"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1594"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1594: bison -fno-caret -o glr-regr17.c glr-regr17.y"
at_fn_check_prepare_trace "glr-regression.at:1594"
( $at_check_trace; bison -fno-caret -o glr-regr17.c glr-regr17.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr17.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$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
$as_echo "$at_srcdir/glr-regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Werror" "glr-regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.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/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Build expected stderr up to and including the "warnings being
  # treated as errors" message.
  cat >experr <<'_ATEOF'
glr-regr17.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1594"
( $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/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=error" "glr-regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.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/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Wnone -Werror" "glr-regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1594: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=none -Werror" "glr-regression.at:1594"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr17.c glr-regr17.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1594"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1597: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1597"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1597"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1597: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr17 glr-regr17.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS" "glr-regression.at:1597"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.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/glr-regression.at:1597"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1599:  \$PREPARSER ./glr-regr17"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1599"
( $at_check_trace;  $PREPARSER ./glr-regr17
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1599"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1599: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1599"
( $at_check_trace; sed >&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"; $as_echo "1.1-2.2: syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1599"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1610' \
  "Missed %merge type warnings when LHS type is declared later" "" 25
at_xfail=no
(
  $as_echo "491. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >glr-regr18.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser

%{
  #include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
%}

%union {
  int type1;
  int type2;
  int type3;
}

%%

sym1: sym2 %merge<merge> { $$ = $1; } ;
sym2: sym3 %merge<merge> { $$ = $1; } ;
sym3: %merge<merge> { $$ = 0; } ;

%type <type1> sym1;
%type <type2> sym2;
%type <type3> sym3;

%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  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





{ set +x
$as_echo "$at_srcdir/glr-regression.at:1645: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr18.c glr-regr18.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr18.c glr-regr18.y" "glr-regression.at:1645"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o glr-regr18.c glr-regr18.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr18.y:28.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
glr-regr18.y:27.18-24:     previous declaration
glr-regr18.y:29.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
glr-regr18.y:28.18-24:     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/glr-regression.at:1645"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1659' \
  "Ambiguity reports" "                              " 25
at_xfail=no
(
  $as_echo "492. $at_setup_line: testing $at_desc ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdio.h>

static void yyerror (const char *msg);
  static int yylex (void);
%}

%debug
%glr-parser

%%
start:
  'a' b 'c' d
| 'a' b 'c' d
;
b: 'b';
d: /* nada.  */;
%%


/* A C error reporting function.  */
static
void yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
  static char const input[] = "abc";
  static size_t toknum = 0;
  int res;
  ;
  assert (toknum < sizeof input / sizeof input[0]);
  res = input[toknum++];
  ;
  return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
  if (getenv("YYDEBUG")
      || (argc == 2
          && (!strcmp (argv[1], "-d") || !strcmp (argv[1], "--debug"))))
    yydebug |= 1;
  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
$as_echo "$at_srcdir/glr-regression.at:1688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1688"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -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/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1688"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1688"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1688"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1688: bison -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "glr-regression.at:1688"
( $at_check_trace; bison -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1688"
$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
$as_echo "$at_srcdir/glr-regression.at:1688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Werror" "glr-regression.at:1688"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }


  # 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]
_ATEOF

  $PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
                 {$1: error: $2\[-Werror=$3]}' experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1688"
( $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/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check --warnings=error.
  cp stderr experr
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=error" "glr-regression.at:1688"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }


  # Now check -Wnone and --warnings=none by making sure that
  # -Werror doesn't change the exit status when -Wnone or
  # --warnings=none is specified.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror" "glr-regression.at:1688"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y -Wnone -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1688: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror" "glr-regression.at:1688"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret -o input.c input.y --warnings=none -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1688"
$at_failed && at_fn_log_failure
$at_traceon; }


  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1691: \$BISON_C_WORKS"
at_fn_check_prepare_dynamic "$BISON_C_WORKS" "glr-regression.at:1691"
( $at_check_trace; $BISON_C_WORKS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1691"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1691: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "glr-regression.at:1691"
( $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/glr-regression.at:1691"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1693:  \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "glr-regression.at:1693"
( $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/glr-regression.at:1693"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1693: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "glr-regression.at:1693"
( $at_check_trace; sed >&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"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token 'a' ()
Shifting token 'a' ()
Entering state 1
Reading a token: Next token is token 'b' ()
Shifting token 'b' ()
Entering state 3
Reducing stack 0 by rule 3 (line 27):
   \$1 = token 'b' ()
-> \$\$ = nterm b ()
Entering state 4
Reading a token: Next token is token 'c' ()
Shifting token 'c' ()
Entering state 6
Reducing stack 0 by rule 4 (line 28):
-> \$\$ = nterm d ()
Entering state 7
Reading a token: Now at end of input.
Stack 0 Entering state 7
Now at end of input.
Splitting off stack 1 from 0.
Reduced stack 1 by rule #2; action deferred.  Now in state 2.
Stack 1 Entering state 2
Now at end of input.
Reduced stack 0 by rule #1; action deferred.  Now in state 2.
Merging stack 0 into stack 1.
Stack 1 Entering state 2
Now at end of input.
Removing dead stacks.
Rename stack 1 -> 0.
On stack 0, shifting token \$end ()
Stack 0 now in state #5
Ambiguity detected.
Option 1,
  start -> <Rule 1, tokens 1 .. 3>
    'a' <tokens 1 .. 1>
    b <tokens 2 .. 2>
    'c' <tokens 3 .. 3>
    d <empty>

Option 2,
  start -> <Rule 2, tokens 1 .. 3>
    'a' <tokens 1 .. 1>
    b <tokens 2 .. 2>
    'c' <tokens 3 .. 3>
    d <empty>

syntax is ambiguous
Cleanup: popping token \$end ()
Cleanup: popping unresolved nterm start ()
Cleanup: popping nterm d ()
Cleanup: popping token 'c' ()
Cleanup: popping nterm b ()
Cleanup: popping token 'a' ()
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1693"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $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 'glr-regression.at:1760' \
  "Predicates" "                                     " 25
at_xfail=no
(
  $as_echo "493. $at_setup_line: testing $at_desc ..."
  $at_traceon


# FIXME: We need genuine test cases with uses of %?.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%expect-rr 1
%%
// Exercise "%?{...}" and "%? {...}".
widget:
  %? {new_syntax} "widget" id new_args  { $$ = f($3, $4); }
| %?{!new_syntax} "widget" id old_args  { $$ = f($3, $4); }
;
id:;
new_args:;
old_args:;
%%
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  at_save_special_files
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1779: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1779"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -fno-caret --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1779: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -fno-caret --xml=xml-tests/test.xml input.y" "glr-regression.at:1779"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -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/glr-regression.at:1779"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1779: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1779"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779"
$at_failed && at_fn_log_failure
$at_traceon; }

  sort xml-tests/test.dot > expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1779: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml | sort"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1779"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml | sort
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1779"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
  at_restore_special_files
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1779: bison -fno-caret input.y"
at_fn_check_prepare_trace "glr-regression.at:1779"
( $at_check_trace; bison -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/glr-regression.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_493